Add brightness slot function

This commit is contained in:
Henry Jameson 2024-10-30 16:01:06 +02:00
parent 1873c75a7f
commit 73f49466a1

View file

@ -23,6 +23,16 @@ export const colorFunctions = {
return { ...colorArg, a: amount }
}
},
brightness: {
argsNeeded: 2,
exec: (args, { findColor }, { dynamicVars, staticVars }) => {
const [color, amountArg] = args
const colorArg = convert(findColor(color, { dynamicVars, staticVars })).hsl
colorArg.l += Number(amountArg)
return { ...convert(colorArg).rgb }
}
},
textColor: {
argsNeeded: 2,
exec: (args, { findColor }, { dynamicVars, staticVars }) => {