fix menu-item magenta

This commit is contained in:
Henry Jameson 2025-03-26 13:55:25 +02:00
parent f1910b37d3
commit 11adf48f4a

View file

@ -112,7 +112,10 @@ export const colorFunctions = {
const color = convert(findColor(colorArg, { dynamicVars, staticVars })).rgb
const amount = Number(amountArg)
const effectiveBackground = dynamicVars.lowerLevelBackground
const effectiveBackground = dynamicVars.lowerLevelBackground ??
dynamicVars.background ??
dynamicVars.inheritedBackground ??
staticVars[colorArg]
const isLightOnDark = relativeLuminance(convert(effectiveBackground).rgb) < 0.5
const mod = isLightOnDark ? 1 : -1
return brightness(amount * mod, color).rgb