UI - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: контроль цветов элементов, допил палитры и реворк основного UI

This commit is contained in:
DCCONSTRUCTIONS
2026-05-01 02:29:39 +03:00
parent 7ff7d83b07
commit a7ab8ee123
15 changed files with 728 additions and 271 deletions
@@ -30,6 +30,8 @@ export {
// NODE.DC runtime accent
export {
applyNodedcAccent,
applyNodedcPassiveCardColor,
applyNodedcPassiveCardSurfaceColor,
getReadableNodedcTextRgb,
nodedcAccentHexToRgb,
normalizeNodedcAccentHex,
@@ -100,3 +100,33 @@ export const applyNodedcAccent = (hex: string | null | undefined): boolean => {
return true;
};
export const applyNodedcPassiveCardColor = (hex: string | null | undefined): boolean => {
if (typeof document === "undefined") return false;
const passiveCardRgb = nodedcAccentHexToRgb(hex);
if (!passiveCardRgb) return false;
const root = document.documentElement;
const onPassiveCardRgb = getReadableNodedcTextRgb(passiveCardRgb);
root.style.setProperty("--nodedc-card-passive-rgb", formatRgbTuple(passiveCardRgb));
root.style.setProperty("--nodedc-on-card-passive-rgb", formatRgbTuple(onPassiveCardRgb));
return true;
};
export const applyNodedcPassiveCardSurfaceColor = (hex: string | null | undefined): boolean => {
if (typeof document === "undefined") return false;
const passiveCardSurfaceRgb = nodedcAccentHexToRgb(hex);
if (!passiveCardSurfaceRgb) return false;
const root = document.documentElement;
const onPassiveCardSurfaceRgb = getReadableNodedcTextRgb(passiveCardSurfaceRgb);
root.style.setProperty("--nodedc-card-passive-surface-rgb", formatRgbTuple(passiveCardSurfaceRgb));
root.style.setProperty("--nodedc-on-card-passive-surface-rgb", formatRgbTuple(onPassiveCardSurfaceRgb));
return true;
};