Skip to content

[css-color-4] Hue interpolation "specified" should be removed #7750

Closed
@fserb

Description

@fserb

Although it sounds like a reasonable and simple idea, the interpolation method called "specified" by the spec is actually extremely costly and complex to be implemented by UAs. The reason for it is that is breaks a basic assumption about colors, namely, that they (apart from some loss of precision) can be represented and converted between different systems.

UAs usually choose an internal color representation (like sRGBA). Hue-based systems (like HSL, HWB) are, in practice, expected to have Hues defined in the [0, 360) region. Outside of that region, colors can be converted out of them, but not preserved. To allow internal representation of arbitrary Hues, UAs need to have special code to store those types of color representation throughout their pipelines.

We can see a problem caused by this on the current Safari TP implementation of hue specified gradients, where Safari follows the proper algorithm (numeric interpolation of hue values), but fails to preserve their value outside of mod 360 (since they are internally converted to sRGB), creating a weirdly unspecified behavior, that doesn't address the original spirit of the spec (the ability to have multiple rotations on the hue circle in a single gradient interpolation).

Considering that it does seem like a reasonable request, but also understanding that there's no pressing use case for it and that there's a big implementation complexity, we'd like to request that this small section of the spec to be removed from CSS Color 4 and then re-discussed at a later time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions