- From: Chris Lilley via GitHub <sysbot+gh@w3.org>
- Date: Wed, 23 Aug 2023 13:16:11 +0000
- To: public-css-archive@w3.org
Re-reading this issue, I am not sure what the remaining problems are, if any. The spec has changed several times since the issue was opened, and to me at least [now seems clear](https://drafts.csswg.org/css-color-4/#rgb-functions):
> Percentages: Allowed for r, g and b
> For r, g and b: 0% = 0.0, 100% = 255.0
> For alpha: 0% = 0.0, 100% = 1.0
and
> The percentage reference range of the color channels comes from the historical fact that many graphics engines stored the color channels internally as a single byte, which can hold integers between 0 and 255. Implementations should honor the precision of the channel as authored or calculated wherever possible. If this is not possible, the channel should be [rounded towards +∞](https://drafts.csswg.org/css-values-4/#combine-integers).
and this seems to work in practice [live test]():
```js
let test = document.createElement("div");
test.style.color = "rgb(90 calc(100%) 100%)";
console.log(test.style.color);
```
Firefox correctly reports
> "rgb(90, 255, 255)"
and Chrome does not seem to implement mixed number and percent in modern `rgb()` yet.
--
GitHub Notification of comment by svgeesus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8485#issuecomment-1689947548 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 23 August 2023 13:16:13 UTC