def hue_and_chroma(color)
      scaled_rgb = to_truecolor_bytes(color)
      scaled_rgb.map! { |component| component.fdiv(255) }
      min, max = scaled_rgb.minmax
      chroma   = max - min

      r, g, b   = scaled_rgb
      hue_prime = chroma.zero? ? 0 : case max
                                     when r then (g - b).fdiv(chroma)
                                     when g then (b - r).fdiv(chroma) + 2
                                     when b then (r - g).fdiv(chroma) + 4
                                     else 0
                                     end
      hue = 60 * hue_prime

      [hue.round, chroma, max, min]
    end
def hue_and_chroma(color)
      scaled_rgb = to_truecolor_bytes(color)
      scaled_rgb.map! { |component| component.fdiv(255) }
      min, max = scaled_rgb.minmax
      chroma   = max - min

      r, g, b   = scaled_rgb
      hue_prime = chroma.zero? ? 0 : case max
                                     when r then (g - b).fdiv(chroma)
                                     when g then (b - r).fdiv(chroma) + 2
                                     when b then (r - g).fdiv(chroma) + 4
                                     else 0
                                     end
      hue = 60 * hue_prime

      [hue.round, chroma, max, min]
    end
This method encapsulates the logic needed to extract hue and chroma from
 a ChunkPNG color. This logic is shared by the cylindrical HSV/HSB and HSL
 color space models.

 @param [Integer] color A ChunkyPNG color.
 @return [Fixnum] hue The hue of the color (0-360)
 @return [Fixnum] chroma The chroma of the color (0-1)
 @return [Fixnum] max The magnitude of the largest scaled rgb component (0-1)
 @return [Fixnum] min The magnitude of the smallest scaled rgb component (0-1)
 @private