Skip to content

[css-typed-om] Move ".colorspace" to the color superclass, readonly #1036

Closed
@tabatkins

Description

@tabatkins

In #1034 (comment), Lea points out that it's annoying to figure out what the colorspace of a color object is.

We already have precedent in Typed OM for helping with this - the math function subclasses expose their function name as a property as well, precisely to avoid this annoying hacky work.

Seems like the most straightforward fix is to move ".colorspace" to the CSSColorValue superclass, as a readonly property that's automatically set to the corresponding function name, and then make it writable on CSSColor.

(Conveniently, the CSSWG just resolved to drop the "lab" predefined color space for color(), so there's no clashes anymore. "rgb" (for rgb()) and "srgb" (for color(srgb)) will be close, but they're distinct.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions