Re: [csswg-drafts] [css-color-4] Specified value for color when calc() is used (#8318)

**Proposed resolution:**  For historical reasons, early resolution of `calc()`, where it resolves down to a single value, in both legacy and modern `rgb()` and `hsl()`, and in `hwb`, and clamping of over-range values, for serializing specified values.

@tabatkins Would that require an 'except as over-ridden by other specifications' in Values 4?

Note that the combination of early resolution and early clamping also deals with annoyances like `Inf`([test 4](https://codepen.io/svgeesus/pen/eYbNGEK?editors=0011)):

```js
let test = document.createElement("div");
test.style.color = "rgb(calc(255) 127 255)";
console.log(test.style.color);
test.style.color = "rgb(calc(1 / 0) 127 255)";
console.log(test.style.color);
```

> "rgb(255, 127, 255)"
> "rgb(255, 127, 255)"

-- 
GitHub Notification of comment by svgeesus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8318#issuecomment-1689888462 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 12:38:27 UTC