UI - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: контроль цветов элементов, допил палитры и реворк основного UI
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user