Changes the semantics of _parseColor so that it can return an array partially filled, to allow the missing elements to be filled from defaults (e.g. if there's no alpha specified, it's not returned) and not from its own default. Additionally, now it returns false to indicate parse failure. Currently, the only caller (_parseCSS) deals with a parse error by using the default color, so it's equivalent to returning an empty array, but the new semantics would allow for example to issue a warning, should that mechanism exist.
Support
background: <color>
andbackground-color: <color>
. The<color>
can now bergb(r, g, b)
orrgba(r, g, b, a)
, as percentage or as a number from 0 to 255, according to the CSS3 specifications http://www.w3.org/TR/css3-color/#rgba-color and following the CSS2 grammar rules in http://www.w3.org/TR/CSS2/grammar.htmlChanges the semantics of
_parseColor
so that it can return an array partially filled, to allow the missing elements to be filled from defaults (e.g. if there's no alpha specified, it's not returned) and not from its own default. Additionally, now it returnsfalse
to indicate parse failure. Currently, the only caller (_parseCSS
) deals with a parse error by using the default color, so it's equivalent to returning an empty array, but the new semantics would allow for example to issue a warning, should that mechanism exist.