facelessuser / coloraide

A library to aid in using colors
https://facelessuser.github.io/coloraide
MIT License
189 stars 11 forks source link

HSL and HWB non-legacy CSS (space format) do not need to be forced to percentage output #371

Open facelessuser opened 11 months ago

facelessuser commented 11 months ago

The CSS spec does not require the new style formats for HSL and HWB to be forced to percentage output, they can also just take plain numbers for non-hue components. As a matter of fact, HWB does not even have a legacy, comma format.

Browsers do not currently follow the spec in this regard and still only recognize these colors with percentages for their non-hue components (excluding alpha).

Currently, we default to using percentages for these two spaces in the new style format. At some point, for consistency, we need to drop this behavior and match what we do with Lab, LCh, etc. For now, we are leaving them as is to avoid confusion for people coming from the browser world to ColorAide. Once browsers catch up to the current CSS specification, we can adjust behavior to match.

facelessuser commented 7 months ago

Chrome finally supports HSL and HWB without percents. Firefox and Safari are currently lagging in support.