HSL color space in Inkscape versus those in html5 and css3

General discussions about Inkscape.
shia2070
Posts: 1
Joined: Tue Oct 30, 2012 6:35 pm

HSL color space in Inkscape versus those in html5 and css3

Postby shia2070 » Tue Oct 30, 2012 7:03 pm

Hi, in the application of HSL space in Inkscape's "fill and stroke" , hue, saturation and light are all represented by values between 0 and 255; while in html5 canvas http://www.w3schools.com/cssref/css_colors_legal.asp and css3 (http://www.w3.org/TR/css3-color/#hsl-color), hue is represented as an angle of the color circle (i.e. 359 hues in 360 degrees), saturation and lightness are represented as percentages. Is Inkscape HSL color space the same one as those specified in.html

v1nce
Posts: 696
Joined: Wed Jan 13, 2010 4:36 am

Re: HSL color space in Inkscape versus those in html5 and cs

Postby v1nce » Tue Oct 30, 2012 9:28 pm

AFAIK inkscape won't store the value in HSL (but in RGB)
The color palette widget let you express your color in HSL but it will convert it on the fly in RGB.

The widget uses 256 values (from 0 to 255) for hue.
So if you want to convert a html5 hue to an inkscape one, you got to multiply the html5 value by 255/359 (and 359/255 the other way around)

Same goes for S & L
Multiply by 255/100 (or 100/255)


Return to “General Discussions”