Skip to content

Opaque colours serialize as rgba(r, g, b, 1) where CSSOM specifies rgb(r, g, b) #227

Description

@lahma

Observed while generating JavaScript bindings for AngleSharp's CSSOM in Jint (sebastienros/jint#3634), on the current AngleSharp.Css.

A colour value serializes as rgba(r, g, b, 1) for a fully opaque colour, where CSSOM's serialization of a <color> (https://drafts.csswg.org/cssom/#serialize-a-css-component-value, the rgb() / rgba() rule: "if the alpha is 1, serialize as rgb()") gives rgb(r, g, b). Scripts and tests that compare element.style.color against rgb(255, 0, 0) see the difference; browsers all serialize the opaque case as rgb(). Happy to send a PR if you would take one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions