fix redmond theme inputs being black on selected statuses

This commit is contained in:
Henry Jameson 2025-01-07 17:50:49 +02:00
parent d0228728f4
commit 3cab1faaf4
2 changed files with 20 additions and 2 deletions

View file

@ -81,9 +81,27 @@ export const colorFunctions = {
return alphaBlend(background, amount, foreground)
}
},
boost: {
argsNeeded: 2,
documentation: 'If given color is dark makes it darker, if color is light - makes it lighter',
args: [
'color: source color',
'amount: how much darken/brighten the color'
],
exec: (args, { findColor }, { dynamicVars, staticVars }) => {
const [colorArg, amountArg] = args
const color = convert(findColor(colorArg, { dynamicVars, staticVars })).rgb
const amount = Number(amountArg)
const isLight = relativeLuminance(color) < 0.5
const mod = isLight ? -1 : 1
return brightness(amount * mod, color).rgb
}
},
mod: {
argsNeeded: 2,
documentation: 'Old function that increases or decreases brightness depending if color is dark or light. Advised against using it as it might give unexpected results.',
documentation: 'Old function that increases or decreases brightness depending if background color is dark or light. Advised against using it as it might give unexpected results.',
args: [
'color: source color',
'amount: how much darken/brighten the color'

View file

@ -94,7 +94,7 @@ Button:toggled:pressed {
}
Input {
background: $mod(--bg -80);
background: $boost(--bg 20);
shadow: --defaultInputBevel;
roundness: 0
}