-
Notifications
You must be signed in to change notification settings - Fork 708
[css-color] Serializing color() values #480
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
Comments
I tend to agree with Tab's statement to treat Sebastian |
I agree with Tab and SebastianZ |
Treating it as legacy syntax is fine for input. But the output from computed style is probably parsed by a lot of content on the Web. If that all of a sudden changes to something unexpected, the world will collapse, the seas will rise, and Trump may get elected. |
Agree with @grorg, unless someone can prove that changing this output is web-compatible. |
Wow. I'm regretting my last statement now. |
:-( |
Reposting a comment I made in #742 as I am closing that one as duplicate: The css-color-4 definition of the computed value of the color property says :
That doesn't sound right:
If the level 4 text is meant to be different from the level 3, we should errata level 3, and be clearer about what exactly is meant. But given the compat data and the newer color functions, neither "always The new color functions that do not yet have a compat baggage, so we should probably be clear before they get one. We could keep them as specified, or maybe convert them to a base notation: As for the comma-less version of rgb() and hsl(), we also should decide if the compute to the legacy syntax (with commas), preseve them as written, or compute to |
The CSS Working Group just discussed
The full IRC log of that discussion
|
Resolved. An input of "color" always serializes as "color" Everything else is undefined. Extra requirement is that "color" serialization doesn't truncate trailing 0 values. e.g. color(srgb 1 0 0). |
Should this go into cssom? |
Probably, yes. |
Shouldn't that rather go to https://drafts.csswg.org/css-color-4/#resolving-color-values <https://drafts.csswg.org/css-color-4/#resolving-color-values> ?
|
Yes. Removing color-3 tag. |
The issue of serializing colors specified through The CSSOM spec is no clearer; first it is said the "shortest base-ten integer serialization" should be used, but the following 7 lines use the "shortest base-ten serialization". |
I agree it is not yet resolved. And the |
The CSS Working Group just discussed
The full IRC log of that discussion<stantonm> topic: Serializing color() values<astearns> github: https://github.com//issues/480 <stantonm> chris: dean raised how does the color function get serialized <stantonm> ... whats a good serialization, for all the new ones they need to be floats <stantonm> ... any problems with that in OM <stantonm> TabAtkins: if it's not int it will serialize property, as long as data model underneath is number <stantonm> chris: for color you can use 0-1, or 0-100% <stantonm> ... 0-1 was simpler <stantonm> emilio: consistent with alpha <stantonm> RESOLVED: color() functions, if they have a choice between percentage and number, they should use number <stantonm> chris: lightness is a percent, how do we handle that specific one <stantonm> TabAtkins: percentage and number equilivence is defined as 0-1 equals 0-100% <stantonm> ... so we can just accept number <stantonm> s/can/can't/ <stantonm> ... in the color function, just follow the rules - which is 0-1 <stantonm> fantasai: agree with tab <stantonm> florian: for match function we take 0-100? <stantonm> christ: eventually caved to just take percent <stantonm> TabAtkins: could be this one color space takes 0-400, so doesn't matter <stantonm> chris: some people use equipment that gives back percent <stantonm> fantasai: adding the percent sign makes sense <chris> s/gives back percent/gives back L in 0 to 100 range and no percent <stantonm> TabAtkins: don't do the weird thing with lab and percentages (?) <stantonm> chris: did it for rgb, so we argued it might make sense for lab <stantonm> ... it's longer so not being used as much <AmeliaBR> We already have RGB functions where percentages map to 0-255 in integers. Because that's the convention for that data type. If integer 0-100 is the convention for lab. <AmeliaBR> ... maybe makes sense to follow. <fantasai> in the color() function? <AmeliaBR> Ummm… I don't know which syntaxes are allowed there. <TabAtkins> Proposed Resolution: the `color(lab ...)` function, like the rest of the color() values, are in the 0-1 (or 0% - 100%) range. And they serialize the same as other color() values (as a 0-1 number). <stantonm> RESOLVED: the `color(lab ...)` function, like the rest of the color() values, are in the 0-1 (or 0% - 100%) range. And they serialize the same as other color() values (as a 0-1 number). |
@grorg wrote:
Those two resolutions are now in the specification @csswg wrote
Those two as well. However, on the 22 Oct 2020 TPAC call, it was also resolved to split out serialization from the specified, computed, used and actual values section into a new section, and I am still working on that, so leaving this open for now. |
The spec no longer says that. Hasn't for some years. (I'm just going through the thread again to be sure nothing was missed). |
All dealt with, CSSWG resolutions implemented, see see Serializing sRGB values
No, they are output as
No, they are output as @grorg do these edits resolve all of your concerns? |
How should values defined using color() be serialized in computed style?
The text was updated successfully, but these errors were encountered: