On Tue, 2014-04-08 at 00:47 -0700, Jon A. Cruz wrote:
On Tue, Apr 8, 2014, at 12:44 AM, Tavmjong Bah wrote:
On Tue, 2014-04-08 at 17:05 +1030, Not Telling wrote:
Hi everyone, Just a suggestion for development of Inkscape, I notice using it that HSV values are in range of [0,256) and I just wanted to suggest that this be corrected.
Basically, because "hue" numbers are an angle in the HSV colourspace hexagon/circle, hue should be out of 360
Also, "saturation" and "value" numbers are percentages, so having them out of 256 doesn't really make any sense from a conceptual point of view.
I plan on implementing CSS 3 Color hsl() [1] in the near future. That might be the time to fix this.
I actually had much of the needed fixes worked up, but was distracted by a few other issues.
Once I can get a solid dev environment going again I should be able to finish this up. (MacPort updates kinda haven't liked my older mac for the last few weeks).
Good! Does it also handle hsla() and rgba()? This would require some code change as the 'a' part is independent of "opacity".
I would like to eventually have the ability to both read and write hsl() as well as named colors. My plan is/was to keep track of what was read in from CSS and store the format so style="fill:red" does not get turned into style="fill:#ff0000" (of course, the computed value would be in rgb). If one sets the fill using the HSL dialog it would be saved as hsl(). At export one could choose to convert all to #rrggbb form.
In a more global view, I also plan on keeping track of where a property is set. For example, if a property is set in an style sheet (<style>...</style>), it won't be written out in a style attribute (style="..."), unless inside Inkscape. If a property is set in an attribute (e.g. fill="red"), it won't end up in a style attribute. This would open up the possibility of adding style sheet editing to Inkscape.
This should be easy to implement once my 'style' branch gets merged.
Tav