-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-color-4] HTML needs an html-compatible, hex serialization of 8 bit/component sRGB colors #10550
Comments
CSS Color 4 has a concept of legacy color syntax. Essentially, pre-css color 4 colors (rgb, rgba, hsl, hsla) get serialized as they always have. Non-legacy colors are serialized as described in csswg.sesse.net/css-color-4. The simplest solution would just be to do exactly what CSS is doing, while preserving "opaque colors are hex" quirk from https://html.spec.whatwg.org/#serialisation-of-a-color.
Could we even link to https://csswg.sesse.net/css-color-4/#serializing-color-function-values? Originally posted by @mysteryDate in whatwg/html#8917 (comment) |
This is to allow the HTML spec "serialization of a color" to be replaced by a reference to CSS Color; while also updating it to cover
|
HTML PRs are now up:
CSS Color defining |
Proposed resolution: CSS WG will work together with WhatWG to add an HTML-compatible, hex serialization of 8 bit/component color, for ease of referencing from HTML LS |
The CSSWG will automatically accept this resolution one week from now if no objections are raised here. Anyone can add an emoji to this comment to express support. If you do not support this resolution, please add a new comment. Proposed Resolution: CSS WG will work together with WhatWG to add an HTML-compatible, hex serialization of 8 bit/component color, for ease of referencing from HTML LS |
RESOLVED: CSS WG will work together with WhatWG to add an HTML-compatible, hex serialization of 8 bit/component color, for ease of referencing from HTML LS |
Originally posted by @annevk in whatwg/html#8917 (comment)
From HTML's perspective we have these requirements:
#...
(when opaque) orrgba(...)
(when not opaque). I think it would make sense if we could set a boolean named parameter called "HTMLCompatible" or some such when serializing to enable that.<input type=color>
: stores a CSS color, but when serializing that color a) needs to be converted to a color space according to thecolorspace
attribute b) when that is Limited sRGB that color b1) needs to be rounded to 8-bits per component and b2) use "HTMLCompatible" just like 2D canvasI think for
<input type=color>
:So here is what this would mean for the CSS Color specification for maximum clarity:
Does that make sense? Once that's in place I can update the
<input type=color>
PR and perhaps also create a separate PR to ensure 2D canvas is properly defined.The text was updated successfully, but these errors were encountered: