-
Notifications
You must be signed in to change notification settings - Fork 689
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-5] Consider using the same identifiers for color-adjust() and relative color syntax #6142
Comments
Ah, so the reason I initially wrote I prefer the shorter keywords from relative colors, because (a) they match the character already used in the function name, so it's intuitively clear what they mean, and (b) it produces shorter code overall, especially vs keywords like (Tangent, but actually I think I made a mistake anyway; HSL and LCH/Lab lightness aren't identical, right? hsl(0 0% 50%) is RGB 50% gray, but lch(50% 0 0) is not.) |
Consistency is my biggest goal here, so if the shorter ones are more preferred, that would be ok. |
@una proposed it and specced it. I think what you are referring to is the old
Please note that we are making the color space mandatory for now. Eventually, the goal was to be able to omit it, although autodetecting it from the component names sounds suboptimal as well, so maybe we should keep it mandatory. Another reason to use more verbose names in
👀 |
Ah yeah, I am. They're closely related, tho; see https://drafts.csswg.org/date/2017-10-11T14:48:05/css-color-4/#modifying-colors which is very similar in overall syntax.
It is, in fact; Una's proposal came out of discussions between her, me, and Adam Argyle about this topic, based on my earlier attempts in the space, and I believe the proposal was based directly off of reading my older proposal and modifying it to have less ()-nesting. I pushed for Una to handle spec edits as a nice First Spec to work on (and to make sure I wasn't overly burdened with Yet Another Spec to work on ^_^).
We should def make that decision now, since as shown here it'll influence the optimal names. I agree, tho, that auto-detecting the colorspace from the used channel names isn't a great strategy, and so just keeping it mandatory is probably the right idea, particularly since that aligns it with the other color-modifying functions. Consistency is good, even if some usages could conceivably be simpler.
Right. ^_^ So yeah, that definitely throws |
Strongly agree. It is the clearest, simplest, and most consistent way forward.
Yes. LCH, JzCzHz and OKLCH all have Chroma. |
Yup, agreed that the color space should be mandatory. Beyond that, is consistency with RCS the only reason to make the names single letter, or is it an independently good change? |
Tangent: oh geez even hue isn't consistent across spaces. Obvious once I think about it, but didn't occur to me at first.
I think it's a good change on its own, for a few reasons:
|
Yup, this is good reasoning, agreed. Especially the part about names being hard to remember. I'm in favor to make them single letter now. Tangent: We should also add a descriptor to |
Oooh, yes, that would be nice. |
I believe @Crissov had previously suggested something on those lines, though I can't find it just now. IIR it went well beyond naming, though. But yes, especially for multichannel colorspaces like CMYKOGV, using names rather than just position in the parameter list is a win. |
@una @argyleink are you ok with this proposed change? |
i'm good with it yep 👍🏻 for all the points mentioned above (tldr; less to remember because we're merging like items) and, just so i'm understanding it all correctly, that would result in spec changes ~like this:
for use ~like this: color-adjust(in hsl, peru l -20%);
color-adjust(in lab, hotpink b -20%); |
This is tangential, but I think the adjusters should be separated from the color via commas. That also allows us to extend the grammar to support multiple adjusters in the future. |
@argyleink I'm not sure what the |
I suggested a @color-profile "sRGB" {
composition: r 0.64 0.33, g 0.30 0.60, b 0.15 0.06;
} |
That's not strictly necessary, so long as the grammar for each adjuster stays in its current simple form. Hmm tho, now that I'm looking at |
they're where the dynamic links normally are, but when i copied from the spec it was in a raw form / uncompiled. figured it didnt matter as the gist of the spec note was the letter instead of the word. sorry that was confusing. |
@LeaVerou wrote:
Does that include |
Agree; that's consistent with what I'm doing in Typed OM right now too. |
@LeaVerou said
Also done although, as we discussed, depending on a descriptor which might get added or removed over the document lifetime gets us into invalid at computed value time, rather than parse time, errors. |
Closed by WG resolution to drop |
As I realize they are kind of competing with each other, I think it would make it a bit easier to compare
color-adjust()
(https://drafts.csswg.org/css-color-5/#coloradjust) and relative color syntax (https://drafts.csswg.org/css-color-5/#relative-colors) if they used the same keywords for color channels.For example,
color-adjust()
usesred
,green
, andblue
, while relative color syntax usesr
,g', and
b`.I think using the more verbose but clear keywords from
color-adjust()
would be preferable, but consistency either way would be nice.The text was updated successfully, but these errors were encountered: