Closed theking2 closed 1 day ago
Yes agreed, although we say it's "legacy", we should have an example saying "all <color>
values compute to the rgb(, , )
format".
as getPropertyValue(_color-property_)
does return a string helpful it would be to state this as such. Certainly when developers attempt to compare these values.
Also hinting to this fact in a separate section would be a good thing. comparisons of color values in in JavaScript values should be discouraged as JavaScript currently has no build in color management or classes of functions.
For now, on the color_value/rgb
page, we can add a note below the syntax section saying the values are still being serialized using old syntax and add a detailed note in https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle#notes.
I'll raise bugs in browser repos to make serialization use new syntaxes.
I'll raise bugs in browser repos to make serialization use new syntaxes.
I wish you success but I doubt it would be possible. Web compatibility is a long and winded story and there surely will be websites relying on the precise serialization format of colors.
True there are seemingly endless ways of how to specify colors. But is JavaScript I'm talking about. There seems to be only one standard way of what is output in getComputedStyle().getPropertyValue()
as far as colors are involved.
MDN URL
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb
What specific section or headline is this issue about?
Try It
What information was incorrect, unhelpful, or incomplete?
Demo should include the very specific JavaScript returns color values for
getComputedStyle()
.rgb(r, g, b)
What did you expect to see?
inclusion of
rgb(r, g, b)
Do you have any supporting links, references, or citations?
tested on brave with
window.getComputedStyle(body).getPropertyValue('background-color')
Do you have anything more you want to share?
No response
MDN metadata
Page report details
* Folder: `en-us/web/css/color_value/rgb` * MDN URL: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb * GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/css/color_value/rgb/index.md * Last commit: https://github.com/mdn/content/commit/bb48907e64eb4bf60f17efd7d39b46c771d220a0 * Document last modified: 2024-08-13T13:25:16.000Z