Re: [csswg-drafts] [css-color-4] Color modifications proposal: extending color functions

> `hsl(red 90%)` would create an HSL color with a lightness of 90%, and the saturation and hue from the provided color. **Potential flaw:** In `hsl(red 0% 50%)`: is the `0%` saturation or lightness? We need to parse the next token to figure that out.

That is just like properties with optional values. We have all sorts of rules for which value is used to fill in missing ones.  Iʼm not sure you are proposing the most intuitive one here. `hsl(red 90%)` could expand to any of the following, all using the hue from `red`:

- `hsl(red 90% 90% 90%)` – this and similar ones would make more sense if `hsl(0deg 90%)` expanded to `hsl(0deg 90% 90% 90%)`
- `hsl(red 90% 90% red)`
- `hsl(red 90% red 90%)`
- `hsl(red red 90% 90%)`
- `hsl(red 90% red red)` – I believe this is the most systematic expansion
- `hsl(red red 90% red)` – assumed in the original proposal above
- `hsl(red red red 90%)`

With RGB, the single provided percentage value might even apply to the first, red channel. 

-- 
GitHub Notification of comment by Crissov
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3187#issuecomment-426907480 using your GitHub account

Received on Thursday, 4 October 2018 07:02:40 UTC