Re: [csswg-drafts] [cssom-1][css-color-4] Move serialization of `<color>` and `<alpha-value>` (#9798)

@cdoublev 

> If I am not mistaken, the algorithm for `<alpha-value>` is required when stored internally as an 8-bit integer, which seems to be the case for most browsers (if not all), and helps explaining why `0.499` may be serialized to `0.498`, for example.

0.499 × 255 = 127.245 so if rounded and stored as uint8_t it will be 127
Math.round(50 * 2.55) = 127
So with trailing zeroes omitted it should be serialized as "0.5", no?

-- 
GitHub Notification of comment by svgeesus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9798#issuecomment-1917506529 using your GitHub account


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

Received on Tuesday, 30 January 2024 17:07:47 UTC