0

I use HSL (HSL = HSB as Heu saturation brightness) color filters. To convert a color to HSL i do :

Color myColor = Color.FromArgb(pixel[blue], pixel[green], pixel[red]); 
int HSLhue = (int)myColor.GetHue();  // note normally its a float but i need an int
float HSLsat = myColor.GetSaturation() * 100;
float HSLlight = myColor.GetBrightness()*100; //mycolorGetBrightness allready is a float.

The problem i have with this code is that HSLheu works OK, and HSLlight works OK too, however when i use a color with some gray in it HSLsat doesnt reflect the proper value. From what i have read about it should be 0 for gray and 1 for pure color. So in my case this is from 0 to 100, but if i check on it to see if saturation falls within a certain range this doesnt work.

user613326
  • 2,140
  • 9
  • 34
  • 63

1 Answers1

0

Oh well it did work afterall, one of those { } typing errors in the filter that used it, i was looking in code to much i starting to sense the matrix in here.

user613326
  • 2,140
  • 9
  • 34
  • 63