8000 [css-color-5] relative color syntax: numbers vs. percentages in `calc()` · Issue #9759 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[css-color-5] relative color syntax: numbers vs. percentages in calc() #9759

@danburzo

Description

@danburzo

With two implementations on stable channels (Safari 16.4+, Chrome 119+) for the relative color syntax, I’m trying to make sense of the incompatible results I’m seeing on my test page, in order to contribute appropriate web platform tests:

  1. The only version that works in Safari is rgb(from #ff6600 calc(100% - r) calc(100% - g) calc(100% - b)) (based, if I remember correctly, on a previous version of the spec?). Should the mixing of <percentage> and <number> in calc() here still produce a valid color?
  2. Am I right to understand that the <number> for rgb() channel keywords is in the range [0,255] and not [0,1] and that Chrome supporting rgb(from #ff6600 calc(1 - r) calc(1 - g) calc(1 - b)) rather than rgb(from #ff6600 calc(255 - r) calc(255 - g) calc(255 - b)) is incorrect?

Metadata

Metadata

Assignees

Labels

Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.Commenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.css-color-5Color modification

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0