������ 14/16/20/40/44: vehicle, ����, ����������, damage floaters, ��������� #20

Merged
min merged 30 commits from feat/vehicle-task14 into main 2026-06-07 14:09:59 +00:00
Showing only changes of commit 192e721ba2 - Show all commits

View File

@ -80,11 +80,16 @@ 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();
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,
]; ];
}; };