mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: gradient interpolation
This commit is contained in:
1 parent
5d098c46fa
commit
4b54b61c35
1 file changed
+4
-7
@@ -137,7 +137,8 @@ export default function Page() {
|
||||
|
||||
{values.map((value, index) => {
|
||||
const deltaPercentage = (value ?? 1) / (values[0] ?? 1) - 1;
|
||||
const significantChange = Math.abs(deltaPercentage) >= 0.15;
|
||||
const normalizedDeltaPercentage =
|
||||
Math.abs(deltaPercentage) * 100 + 25;
|
||||
|
||||
return (
|
||||
<Table.Cell
|
||||
@@ -154,12 +155,8 @@ export default function Page() {
|
||||
? value > values[0]
|
||||
: value < values[0]
|
||||
)
|
||||
? significantChange
|
||||
? theme.colors.componentInteractiveActive_green
|
||||
: theme.colors.componentInteractive_green
|
||||
: significantChange
|
||||
? theme.colors.componentInteractiveActive_red
|
||||
: theme.colors.componentInteractive_red,
|
||||
? `color-mix(in srgb, ${theme.colors.componentInteractiveActive_green} ${normalizedDeltaPercentage}%, ${theme.colors.componentInteractiveActive_green}00)`
|
||||
: `color-mix(in srgb, ${theme.colors.componentInteractiveActive_red} ${normalizedDeltaPercentage}%, ${theme.colors.componentInteractiveActive_red}00)`,
|
||||
}}
|
||||
>
|
||||
<Flex
|
||||
|
||||
Reference in new issue
Block a user