Re: [csswg-drafts] [css-color-5] Is relative colors "omitted alpha" rule useful? (#10991)

Yeah, I argued for the omitted-alpha behavior (and was [actually the original contributor](https://github.com/w3c/csswg-drafts/commit/f2b9bb17f8565d946c7e4acba7bf24d2ef731f1b); Chris's commit is just rearranging that text), and I still think it's a good idea.

Alpha is the only channel that exists in every single color syntax, with identical meaning. So it's always *safe* to transfer the alpha like this, in a way that any other channel wouldn't be.

More importantly, it's pretty much *independent* of the rest of the color. Nearly any meaningful operation you could possibly do to a color will adjust its non-alpha components *only*, unless the operation is specifically to adjust the alpha. Virtually nothing does *both*: lighten, darken, saturate, grayscale, sepia, hue shift, they're all alpha-independent. As such, it's easy to *forget* to handle the alpha when you're working on non-alpha components.

Put another way, *almost every single relative color ever written* will want to put `/ alpha` at the end if this is removed. That's silly boilerplate, at that point; it's a minor but persistent footgun that will force people to constantly go "why does this look wrong? oh, duh, it's lost its alpha, gotta put `/ alpha` on it". And it's easy for the mistake to go unnoticed when testing your initial styles since you likely won't think to test with a transparent color; it'll only show up later when you try to use a partially-transparent color in production and annoyingly end up with all your derived colors being fully opaque.

So, no, we won't have consensus to remove it; I feel pretty strongly that the current behavior is a good idea.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10991#issuecomment-2389746525 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 2 October 2024 21:44:25 UTC