Re: [csswg-drafts] [css-color-5] Clarification needed on type of r, g, b constants in "relative color syntax" for rgb() (#6044)

A few days ago I pushed some significant edits cleaning up that section of the spec; it looks like the issue preventing the latest version from displaying on the drafts server has been fixed, so the cases you're asking should be answered now.

In particular, I tweaked how the rgb() function handles its relative form, allowing mixed numbers and percentages, precisely so that the example you're citing would actually work (because I think it should). (Absolute syntax still requires you to pick one or the other and use it for all three components.)

> rgb(from indianred calc(r+1) calc(g+1) calc(b+1))

This would be invalid, however, since the channel keywords are always percentages. We can't have values whose types depend on unification with the rest of the expression; or at least, I'm not willing to write a spec for type unification in CSS more than we currently do. ^_^

(I also fixed the specification wrt the `h` keywords - they're now properly angles, not numbers - and adjusted the examples to match.)

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


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

Received on Tuesday, 2 March 2021 01:33:41 UTC