Add brightness slot function
This commit is contained in:
parent
1873c75a7f
commit
73f49466a1
|
@ -23,6 +23,16 @@ export const colorFunctions = {
|
||||||
return { ...colorArg, a: amount }
|
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: {
|
textColor: {
|
||||||
argsNeeded: 2,
|
argsNeeded: 2,
|
||||||
exec: (args, { findColor }, { dynamicVars, staticVars }) => {
|
exec: (args, { findColor }, { dynamicVars, staticVars }) => {
|
||||||
|
|
Loading…
Reference in a new issue