You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this function currently in effect? It seems that you've already considered a big issue with comfyUI colors already, but aren't using it (maybe because of a technical limitation of litegraph?)
function getContrastColor(hexColor) {
// Remove the # symbol if it exists
if (hexColor.startsWith("#")) {
hexColor = hexColor.slice(1);
}
// Convert the hex values to decimal (base 10) integers
const r = parseInt(hexColor.slice(0, 2), 16) / 255;
const g = parseInt(hexColor.slice(2, 4), 16) / 255;
const b = parseInt(hexColor.slice(4, 6), 16) / 255;
// Calculate the relative luminance
const L = 0.2126 * r + 0.7152 * g + 0.0722 * b;
// Use the contrast ratio to determine the text color
return L > 0.179 ? "#000000" : "#FFFFFF";
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is this function currently in effect? It seems that you've already considered a big issue with comfyUI colors already, but aren't using it (maybe because of a technical limitation of litegraph?)
Beta Was this translation helpful? Give feedback.
All reactions