def from_hsv(hue, saturation, value, alpha = 255)
      raise ArgumentError, "Hue must be between 0 and 360" unless (0..360).cover?(hue)
      raise ArgumentError, "Saturation must be between 0 and 1" unless (0..1).cover?(saturation)
      raise ArgumentError, "Value/brightness must be between 0 and 1" unless (0..1).cover?(value)

      chroma = value * saturation
      rgb    = cylindrical_to_cubic(hue, saturation, value, chroma)
      rgb.map! { |component| ((component + value - chroma) * 255).to_i }
      rgb << alpha
      rgba(*rgb)
    end
def from_hsv(hue, saturation, value, alpha = 255)
      raise ArgumentError, "Hue must be between 0 and 360" unless (0..360).cover?(hue)
      raise ArgumentError, "Saturation must be between 0 and 1" unless (0..1).cover?(saturation)
      raise ArgumentError, "Value/brightness must be between 0 and 1" unless (0..1).cover?(value)

      chroma = value * saturation
      rgb    = cylindrical_to_cubic(hue, saturation, value, chroma)
      rgb.map! { |component| ((component + value - chroma) * 255).to_i }
      rgb << alpha
      rgba(*rgb)
    end
Creates a new color from an HSV triple.

 Create a new color using an HSV (sometimes also called HSB) triple. The
 words `value` and `brightness` are used interchangeably and synonymously
 in descriptions of this colorspace. This implementation follows the modern
 convention of 0 degrees hue indicating red.

 @param [Fixnum] hue The hue component (0-360)
 @param [Fixnum] saturation The saturation component (0-1)
 @param [Fixnum] value The value (brightness) component (0-1)
 @param [Fixnum] alpha Defaults to opaque (255).
 @return [Integer] The newly constructed color value.
 @raise [ArgumentError] if the hsv triple is invalid.
 @see http://en.wikipedia.org/wiki/HSL_and_HSV