Hue shift when adjusting saturation
NateBaldwinDesign opened this issue · 0 comments
NateBaldwinDesign commented
Description
Adjusting Theme
or Color
saturation results in unexpected hue shifts. This is especially visible for blues. This is due to the use of HSLuv for deriving new colors with updated saturation levels.
Steps to reproduce
- Create a theme with a blue color scale:
const color = new Color({ name: 'Color', colorKeys: ['#2451FF', '#C9FEFE', '#012676'], ratios: [3, 4.5], colorspace: 'CAM02' });
const theme = new Theme({ colors: [color], backgroundColor: '#f5f5f5', output: 'RGB', saturation: 60 });
- Take the output RGB colors from
theme.contrastColorValues
and paste them into a visual tool like Figma - Change the saturation of the theme to
60
by running
theme.saturation = 60;
- Take the output RGB colors from the updated theme using
theme.contrastColorValues
and paste them side-by-side in a visual tool like Figma - Observe the hue appears purple-ish for the desaturated colors when compared to the original
Expected behavior
Expect hue to be preserved in appearance.
Screenshots
Leonardo package and version
1.0.0-alpha.16
Environment
- Browser(s) and OS(s):