1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

made cubical desaturation

This commit is contained in:
Fedor Katurov 2021-10-07 18:08:47 +07:00
parent 95ec0f2e0e
commit ba4bf28834

View file

@ -10,6 +10,6 @@ export const normalizeBrightColor = (color?: string) => {
const saturation = hsla[1]; const saturation = hsla[1];
const lightness = hsla[2]; const lightness = hsla[2];
const desaturated = saturation > 0.3 ? desaturate(color, Math.min(saturation, 0.4)) : color; const desaturated = desaturate(color, saturation ** 3);
return lightness > 0.3 ? darken(desaturated, Math.min(lightness, 0.2)) : desaturated; return darken(desaturated, lightness ** 3);
}; };