mirror of
https://github.com/logto-io/logto.git
synced 2025-02-03 21:48:55 -05:00
fix(shared): fix dark color generator (#1719)
This commit is contained in:
parent
7579abaea4
commit
3deb98c18d
1 changed files with 2 additions and 2 deletions
|
@ -4,13 +4,13 @@ import color from 'color';
|
||||||
export const absoluteLighten = (baseColor: color, delta: number) => {
|
export const absoluteLighten = (baseColor: color, delta: number) => {
|
||||||
const hslArray = baseColor.hsl().round().array();
|
const hslArray = baseColor.hsl().round().array();
|
||||||
|
|
||||||
return color([hslArray[0] ?? 0, hslArray[1] ?? 0, hslArray[2] ?? 0 + delta], 'hsl');
|
return color([hslArray[0] ?? 0, hslArray[1] ?? 0, (hslArray[2] ?? 0) + delta], 'hsl');
|
||||||
};
|
};
|
||||||
|
|
||||||
export const absoluteDarken = (baseColor: color, delta: number) => {
|
export const absoluteDarken = (baseColor: color, delta: number) => {
|
||||||
const hslArray = baseColor.hsl().round().array();
|
const hslArray = baseColor.hsl().round().array();
|
||||||
|
|
||||||
return color([hslArray[0] ?? 0, hslArray[1] ?? 0, hslArray[2] ?? 0 - delta], 'hsl');
|
return color([hslArray[0] ?? 0, hslArray[1] ?? 0, (hslArray[2] ?? 0) - delta], 'hsl');
|
||||||
};
|
};
|
||||||
|
|
||||||
export const generateDarkColor = (lightColor: string) =>
|
export const generateDarkColor = (lightColor: string) =>
|
||||||
|
|
Loading…
Add table
Reference in a new issue