[css-houdini-drafts] [css-typed-om] define `toRGB()` method (#1028)

svgeesus has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [css-typed-om] define `toRGB()` method ==
In [4.6 CSSColorValue objects](https://drafts.css-houdini.org/css-typed-om/#colorvalue-objects), the method `toRGB()` is insufficiently defined:

> The `toRGB()` method of `CSSColorValue` objects must, when called on this, convert this into an sRGB color, and return a new `CSSRGB` object with its `r`, `g`, `b`, and `alpha` internal slots set appropriately to represent that color. 

First, it is good that the colorspace for the method is stated (sRGB). However there is no reference given for sRGB. 

There is no reference for the steps needed for  _convert this into an sRGB color_

It is probably assumed that if `this` has no alpha, the `alpha` slot is set to 1.0 but this should be explicitly stated.

In general, a normative reference to the appropriate sections of CSS Color 4 would suffice to correct this:

[sRGB](https://www.w3.org/TR/css-color-4/#valdef-color-srgb)
[convert this into an sRGB color](https://www.w3.org/TR/css-color-4/#lab-to-predefined)

Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/1028 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 11 May 2021 15:17:04 UTC