1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-26 05:16:41 +07:00

added lab post lines

This commit is contained in:
Fedor Katurov 2021-10-12 16:21:08 +07:00
parent a553a06ac5
commit bf16c0ca22
6 changed files with 33 additions and 5 deletions

View file

@ -10,6 +10,6 @@ export const normalizeBrightColor = (color?: string, saturationExp = 3, lightnes
const saturation = hsla[1];
const lightness = hsla[2];
const desaturated = desaturate(color, saturation ** saturationExp);
return darken(desaturated, lightness ** lightnessExp);
const desaturated = saturationExp > 1 ? desaturate(color, saturation ** saturationExp) : color;
return lightnessExp > 1 ? darken(desaturated, lightness ** lightnessExp) : desaturated;
};