Skip to content

Commit 8ddfcc0

Browse files
authored
Clarify required precision and rounding behavior for color channels
Helps to resolve w3c#1983 as to the importance of honoring authored numbers, and the required rounding behavior if the precision is not honored.
1 parent da9631b commit 8ddfcc0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

css-color-4/Overview.bs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,9 @@ The RGB functions: ''rgb()'' and ''rgba()''</h3>
272272
but ''255'' represents the maximum.
273273
These values come from the fact that many graphics engines store the color channels internally as a single byte,
274274
which can hold integers between 0 and 255.
275-
However, the CSS syntax allows full <<number>>s,
276-
not just <<integer>>s,
277-
for authoring convenience.
275+
Implementations should honor the precision of the channel as authored wherever possible.
276+
If this is not possible, the channel should be rounded to the closest value,
277+
rounding up if two values are equally close.
278278

279279
The final argument, the <<alpha-value>>, specifies the alpha of the color.
280280
If given as a <<number>>, the useful range of the value is ''0''

0 commit comments

Comments
 (0)