def to_hsv(color, include_alpha = false)
      hue, chroma, max, _ = hue_and_chroma(color)
      value      = max
      saturation = chroma.zero? ? 0.0 : chroma.fdiv(value)

      include_alpha ? [hue, saturation, value, a(color)] :
                      [hue, saturation, value]
    end
def to_hsv(color, include_alpha = false)
      hue, chroma, max, _ = hue_and_chroma(color)
      value      = max
      saturation = chroma.zero? ? 0.0 : chroma.fdiv(value)

      include_alpha ? [hue, saturation, value, a(color)] :
                      [hue, saturation, value]
    end
Returns an array with the separate HSV components of a color.

 Because ChunkyPNG internally handles colors as Integers for performance
 reasons, some rounding  occurs when importing or exporting HSV colors
 whose coordinates are float-based.  Because of this rounding, #to_hsv and
 #from_hsv may not be perfect inverses.

 This implementation follows the modern convention of 0 degrees hue
 indicating red.

 @param [Integer] color The ChunkyPNG color to convert.
 @param [Boolean] include_alpha Flag indicates whether a fourth element
    representing alpha channel should be included in the returned array.
 @return [Array[0]] The hue of the color (0-360)
 @return [Array[1]] The saturation of the color (0-1)
 @return [Array[2]] The value of the color (0-1)
 @return [Array[3]] Optional fourth element for alpha, included if
    include_alpha=true (0-255)
 @see http://en.wikipedia.org/wiki/HSL_and_HSV