I'm writing an HSVtoRGB method for my game framework, and when going through the hues, this happens -> <http://youtu.be/ACBwR_0iMWE>.

Here is the code.

```
public static Color HSVtoRGB(float hue, float saturation, float value, float alpha)
    {
        if(hue > 1 || saturation > 1  || value > 1) throw new Exception("values cannot be more than 1!");
        if (hue < 0 || saturation < 0|| value < 0) throw new Exception("values cannot be less than 0!");

        Color output = new Color();
        if (Math.Abs(saturation) < 0.001)
        {
            output.R = (byte) (value*byte.MaxValue);
            output.G = (byte) (value*byte.MaxValue);
            output.B = (byte) (value*byte.MaxValue);
        }
        else
        {
            hue = hue/60f;
            float f = hue - (int)hue;
            float p = value*(1f - saturation);
            float q = value*(1f - saturation*f);
            float t = value*(1f - saturation*(1f - f));
            switch ((int)hue)
            {
                case (0) :
                    output = new Color(value * 255, t * 255, p * 255, alpha);
                    break;
                case (1):
                    output = new Color(q * 255, value * 255, p * 255, alpha);
                    break;
                case (2):
                    output = new Color(p * 255, value * 255, t * 255, alpha);
                    break;
                case (3):
                    output = new Color(p * 255, q * 255, value * 255, alpha);
                    break;
                case (4):
                    output = new Color(t * 255, p * 255, value * 255, alpha);
                    break;
                case (5):
                    output = new Color(value * 255, p * 255, q * 255, alpha);
                    break;
                default :
                    throw new Exception("RGB color unknown!");
            }

        }
        return output;
    }

```

When adding `.001f` to the hue, it cause it to go from red to yellow but then sticks at yellow until it rolls back over to 0. Please note I am using `Microsoft.Xna.Framework.Color` not `System.Drawing.Color`.

For reference, here is the HSVtoRGB method of [Flixel Power Tools](http://www.photonstorm.com/flixel-power-tools), basically what I am trying to copy. 

```
        public static function HSVtoRGB(h:Number, s:Number, v:Number, alpha:uint = 255):uint
    {
        var result:uint;

        if (s == 0.0)
        {
            result = getColor32(alpha, v * 255, v * 255, v * 255);
        }
        else
        {
            h = h / 60.0;
            var f:Number = h - int(h);
            var p:Number = v * (1.0 - s);
            var q:Number = v * (1.0 - s * f);
            var t:Number = v * (1.0 - s * (1.0 - f));

            switch (int(h))
            {
                case 0:
                    result = getColor32(alpha, v * 255, t * 255, p * 255);
                    break;

                case 1:
                    result = getColor32(alpha, q * 255, v * 255, p * 255);
                    break;

                case 2:
                    result = getColor32(alpha, p * 255, v * 255, t * 255);
                    break;

                case 3:
                    result = getColor32(alpha, p * 255, q * 255, v * 255);
                    break;

                case 4:
                    result = getColor32(alpha, t * 255, p * 255, v * 255);
                    break;

                case 5:
                    result = getColor32(alpha, v * 255, p * 255, q * 255);
                    break;

                default:
                    FlxG.log("FlxColor Error: HSVtoRGB : Unknown color");
            }
        }

        return result;
    }

```