Parses a HTML color and gives back a RGBA triplet. Params: htmlColorString = A CSS string describing a color. Returns: A 32-bit RGBA color, with each component between 0 and 255. See_also: https://www.w3.org/TR/css-color-4/ Example: --- import printed.htmlcolors; parseHTMLColor("black"); // all HTML named colors parseHTMLColor("#fe85dc"); // hex colors including alpha versions parseHTMLColor("rgba(64, 255, 128, 0.24)"); // alpha parseHTMLColor("rgb(9e-1, 50%, 128)"); // percentage, floating-point parseHTMLColor("hsl(120deg, 25%, 75%)"); // hsv colors parseHTMLColor("gray(0.5)"); // gray colors parseHTMLColor(" rgb ( 245 , 112 , 74 ) "); // strips whitespace ---
Implements CSS Color Module Level 4.