From 73f49466a15279a9ccc23b3ee538ab7ec98ee49e Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 30 Oct 2024 16:01:06 +0200 Subject: [PATCH] Add brightness slot function --- src/services/theme_data/theme3_slot_functions.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/services/theme_data/theme3_slot_functions.js b/src/services/theme_data/theme3_slot_functions.js index 24652429..8600217a 100644 --- a/src/services/theme_data/theme3_slot_functions.js +++ b/src/services/theme_data/theme3_slot_functions.js @@ -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 }) => {