Re: [csswg-drafts] [css-color-6] How to support color math involving more than one color? (#11533)

@tiaanl You need spaces around operators in math functions, so it woudl be `calc(l-1 - l-2)`, etc. (This is precisely to avoid that sort of ambiguity.) That said, I do like just using plain letter and number, like `c2` better; the dash makes the otherwise-tiny identifier look far more heavyweight than it needs to be.

@LeaVerou I agree something like this is useful. It's simply impossible to mix two colors in a mathematical way right now, which does indeed block several good use-cases.

I'm not the *happiest* about the readability of just listing several colors before the components, but I can't come up with a better syntax given the syntax we're starting from. I think it's probably the best we can do.

I definitely prefer just using c2/etc for the naming. No need to get complicated here; that syntax space should be safe to reserve for colors.

Another possibility, which I'm not super happy with, is to revive your older idea of a component-extractor function. That way, you can pull out the components you need from the second color into variables, then use them in RCS normally. It's more verbose, but even more low-level. *In theory*, it would also mean you could mix components from different color spaces, but I doubt that would ever be a meaningful operation.

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


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

Received on Thursday, 30 January 2025 16:42:46 UTC