- From: Peter Linss via GitHub <sysbot+gh@w3.org>
- Date: Tue, 15 Dec 2020 18:23:41 +0000
- To: public-houdini-archive@w3.org
> Wait, is that all it is doing? An object model of the sRGB-only rgb() function? I don't understand how that is useful. Having not seen the actual spec prose Tab is working on, I can't say. But I can say what I believe it should be doing. Yes, there should be a CSSRGB (modulo bikeshedding) class whose primary role is to model a CSS `rgb()` function. And that's all. The usefulness is in constructing, parsing, manipulating, and serializing CSS without using the ancient string-based APIs. e.g. I should be able to load a style sheet containing `color: rgb(1,2,3)`, access the value of the `color` property as an object, and set `g` to 42 via code like `value.g = 42`, and not have to parse that string and compose a new one. That's the purpose of the CSS Typed OM module, not to be a generic color handling module. > Does the #rrggbb form have a different object? Does lab() have a different object? Yes, that should be a CSSHexColor (or whatever we call it). We should also have a CSSLAB (for `lab()`), CSSColor (for `color()`) etc., that each model the respective CSS constructs, and will serialize as the same construct they were constructed as > From the June 2020 Houdini minutes it seemed that there was consensus to have a color object, regardless of how it had originally been specified - so that there can be color conversion, color manipulation, and extras like WCAG contrast ratio, gamut mapping, and so forth. Right, and that should be a Color class (and whatever appropriate subclasses, I trust you and Lea to have the best input on the shape of that API). But it should not be a *CSS* color class as it's representing a color, not a CSS construct. And it should not be in this module (and arguably should not be a CSS module either as it should also be used in Canvas APIs, etc). We should be able to convert from the CSS color constructs to a Color object and vice-versa. The Color class should have all the conversion, manipulation, and extra functionality, not the CSS color objects (though I'm happy to add convenience methods to the CSS color classes once we've defined the Color class(es)). I fear the two concepts have become conflated here. -- GitHub Notification of comment by plinss Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/1014#issuecomment-745476246 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 15 December 2020 18:23:43 UTC