title: Converting RGB to HSB Colors
body: <p>I am trying to convert a HSB Color to RGB. The way I am doing that is </p>
  
  <pre><code>System.Windows.Media.Color winColor = value;
  System.Drawing.Color drawColor = System.Drawing.Color.FromArgb(winColor.R, winColor.G, winColor.B);
  Hue = (byte)(drawColor.GetHue()*255);
  Saturation = (byte)(drawColor.GetSaturation()*255);
  Luminosity = (byte)(drawColor.GetBrightness()*255);
  </code></pre>
  
  <p>I find that when I have <code>FF0000</code>, it will be converted to <code>H = 0, S = 255, L = 127</code> which converts to RGB <code>FF0E0E</code>. I think Luminosity should be 120? Or am I getting the whole HSB thing wrong? When I look at the color picker in Photoshop, Hue is 0-360 degrees, Saturation, Luminosity is 0-100%. I am having HSB values ranging from 0 - 255, am I doing it wrong?</p>