Team Create (���������� ��������������) + ���������� ���� + ������ 16/17/20/40/44/05 #34

Merged
min merged 69 commits from restore/all-tasks into main 2026-06-08 01:13:01 +00:00
Showing only changes of commit c9498b086e - Show all commits

View File

@ -80,11 +80,17 @@ function registerSkyShader() {
const hexToRgb = (hex) => { const hexToRgb = (hex) => {
if (Array.isArray(hex)) return hex; if (Array.isArray(hex)) return hex;
const h = String(hex || '#ffffff').replace('#', ''); let h = String(hex || '#ffffff').replace('#', '').trim();
// Короткая форма #fff → #ffffff.
if (h.length === 3) h = h[0] + h[0] + h[1] + h[1] + h[2] + h[2];
if (h.length < 6) h = (h + 'ffffff').slice(0, 6);
const r = parseInt(h.substring(0, 2), 16);
const g = parseInt(h.substring(2, 4), 16);
const b = parseInt(h.substring(4, 6), 16);
return [ return [
parseInt(h.substring(0, 2), 16) / 255, (Number.isFinite(r) ? r : 255) / 255,
parseInt(h.substring(2, 4), 16) / 255, (Number.isFinite(g) ? g : 255) / 255,
parseInt(h.substring(4, 6), 16) / 255, (Number.isFinite(b) ? b : 255) / 255,
]; ];
}; };