Open sbj42 opened 3 months ago
A color in "legacy rgb syntax" with no alpha (e.g. rgb(255, 255, 255)) appears to be properly handled by parseColor. However there are other valid color formats that are not handled.
rgb(255, 255, 255)
parseColor
See https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb#formal_syntax
The following valid CSS colors are not parsed properly by parseColor:
rgb(255 255 255)
rgb(255 255 255 / 0.5)
rgb(255 255 255 / 50%)
rgb(255 255 255 / none)
rgb(255, 255, 255, 0.5)
rgb(255, 255, 255, 50%)
rgb(255 100% 100%)
rgb(255 none none)
Note all of those should also work with rgba(), as it has the same syntax as rgb() - e.g. the alpha value is optional in both.
rgba()
rgb()
A color in "legacy rgb syntax" with no alpha (e.g.
rgb(255, 255, 255)
) appears to be properly handled byparseColor
. However there are other valid color formats that are not handled.See https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb#formal_syntax
The following valid CSS colors are not parsed properly by
parseColor
:rgb(255 255 255)
rgb(255 255 255 / 0.5)
rgb(255 255 255 / 50%)
rgb(255 255 255 / none)
rgb(255, 255, 255, 0.5)
rgb(255, 255, 255, 50%)
rgb(255 100% 100%)
rgb(255 none none)
Note all of those should also work with
rgba()
, as it has the same syntax asrgb()
- e.g. the alpha value is optional in both.