Skip to content

[css-color-4] Spec doesn't specify whether implementation must honor <decimal> in rgb/rgba or if it can truncate to an <integer> #1983

@csnardi

Description

@csnardi

The RGB functions: rgb() and rgba() states that:

These values come from the fact that many graphics engines store the color channels internally as a single byte, which can hold integers between 0 and 255. However, the CSS syntax allows full <number>s, not just <integer>s, for authoring convenience.

However, this section of the spec is unclear as to whether an implementation must try to honor the color channels with decimals preserved or if the implementation can truncate/round the <number> to an integer. Edge has implemented this part of the spec, and appears to simply truncate the number. Chromium is thinking about implementing it, but wants to clarify this section first.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions