8000 [css-color-5] Interpolation of system color keywords · Issue #5780 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[css-color-5] Interpolation of system color keywords #5780

@kbabbitt

Description

@kbabbitt

#3847 resolved that system color keywords should compute to themselves. There was a question left open regarding interpolation. There have been fragments of further discussion around this, but I haven't seen a formalized resolution, so I wanted to raise it as its own issue.

#3847 (comment) suggested that system colors should be treated the same as currentcolor: convert to a used value and interpolate based on that, per https://drafts.csswg.org/css-color-5/#interpolation:

Interpolating to or from currentcolor is possible. The numerical value used for this purpose is the used value.

#5392 (comment) suggested using color-mix() to interpolate between system color keywords. For example, if we're running an interpolation between the system color keywords canvas and menu, and the timing function just returned a value of 0.4, the interpolated value would be color-mix(canvas 40%, menu).

Though the color-mix() suggestion was mine, I'm not particularly attached to it. The "resolve to used value" behavior seems less likely to introduce compat issues, and after implementing #3847 in Blink behind a flag, I discovered that it already had the "resolve to used value" behavior.

Either way, I'm hoping we can get the desired behavior covered in the spec. What does the working group think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.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