Closed jcward closed 8 years ago
On the side note: comparing rgb values is bad and not even correct (it's not linear), should use hsl or something similar.
Yes, the 6 matches are intentional. Each of R, G, and B are parsed as integer
and optional_%
. If you don't use a percent, it's blank (or null in Haxe.) So rgb(255,17%,0)
is supported. In CSS you can always write the 0 with or without any units, because 0 == 0% == 0px.
I've added braces.
Looks okay to me.
@ibilon ?
Looks good for me too.
Per: https://www.w3.org/TR/SVG/types.html#DataTypeColor
Parses both numeric and % values, e.g.: rgb(255,127,0) == rgb(100%, 50%, 0)
Includes testcase.
Side note: We might need the test suite at some point to tolerate a slight difference in pixel color. Especially with opacity and % color -- a pixel is wholly counted as "incorrect" if it is even different by 1 in any R, G or B. This makes it easy to get false negatives by adjusting opacity / percentages in the testcases.