sebastienros/fluid

ColorFilters do not support all data types for CSS colors that are defined by the CSS standard

Opened this issue · 1 comments

While working on #497 I noticed that the CSS standard allows additional data types as arguments, that are not supported by this library:

rgb/rgba:

  • Parameters R, G and B and A are allowed to be <number>s, which means something like rgb(10.1, 11.2, 11.3, .4) (notice the missing number before the decimal point) should be allowed.
  • Parameters R, G and B and A are allowed to be <percentage>s, which means something like rgb(10%, 10%, 20%, 40%) should be allowed

hls/hlsa:

  • Parameter hue is allowed to be an <angle> so something like hls(1rad, 50%, 50%) should be allowed
    • angle can have one of the following units: deg, rad, grad, or turn
  • Parameter alpha is allowed to be a <percentage>, which means something like hls(4, 50%, 50%, 50%) should be allowed.

See:

https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hsl
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb
https://developer.mozilla.org/en-US/docs/Web/CSS/number
https://developer.mozilla.org/en-US/docs/Web/CSS/percentage
https://developer.mozilla.org/en-US/docs/Web/CSS/angle

We need to work one this after the related PR has been merged