-
Notifications
You must be signed in to change notification settings - Fork 719
[css-color-5] Is color-adjust() needed, now that we have relative color syntax? #6179
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
Indeed, originally (check out the June 2019 F2F minutes) they were meant as alternatives of which we'd only keep one, but the editors have been so far unsuccessful in converging to one of the two. Note that your two examples are not equivalent: the adjusters in Note that both of these are mid-level ( |
Yeah I noticed that afterward. I think that behavior might be fine in a vacuum, but in conjunction with relative color syntax, it's def confusing.
Yup, that's definitely a separate thing to talk about (and I agree, a good idea). |
Note that these were both added at the same time, per CSSWG resolution. The spec also explicitly notes that we intend to merge, modify, or drop so that we end up with one final way, rather than two ways. |
I agree. The main missing function in RCS is a relative version of |
Note that in another issue I proposed |
@LeaVerou wrote:
This descriptor has been added
Relative color syntax for the @tabatkins wrote:
Yes. It is (with the latest additions) strictly more powerful, arguably easier to read too. I think the draft should be published with the current state of both |
Color 5 was published 1 June with both Before I put effort into serialization of |
The CSS Working Group just discussed
The full IRC log of that discussion |
Originally,
color-adjust()
was the only way to modify a starting color in carefully specified ways. However, we've since added the relative color syntax, doing something very similar.In fact, as far as I can tell, relative color syntax completely subsumes color-adjust(). At least in the current grammar, color-adjust() can only adjust a single channel (tho there's a good chance we'll change that; see Lea's comment), and it can only do so as a % adjustment. Relative color syntax, on the other hand, can adjust all the channels at once, and can do arbitrarily complicated mathematical adjustments to them, including but definitely not limited to % adjustment.
It also just seems a little easier to read, in my opinion: compare
color-adjust(lch, red h 20%)
vslch(from red l c calc(h * .2))
.I think at this point, addressing the issues with
color-adjust()
(allowing multiple channels, allowing more complex mathematical adjustment) would just be bringing it into alignment with relative color-syntax, not giving any additional features.The text was updated successfully, but these errors were encountered: