- From: Boris Zbarsky <bzbarsky@MIT.EDU>
- Date: Mon, 07 Jul 2014 21:28:32 -0400
- To: www-style@w3.org
On 7/7/14, 8:48 PM, Simon Sapin wrote:
> A trick I’ve seen in stuff made by Lea Verou to use the browser’s color
> parsing code is to set e.g. someElement.style.color to the string to
> parse, then get getComputedStyle(someElement).color, which is in rgb()
> or rgba() format and much easier to hand-parse.
While this is doable, it has a few drawbacks:
1) It's slower than a custom API for parsing colors.
2) It can't be done in workers, whereas exposing color parsing in
particular may not be too super-terrible in workers.
-Boris
Received on Tuesday, 8 July 2014 01:29:00 UTC