def cylindrical_to_cubic(hue, saturation, y_component, chroma)
      hue_prime = hue.fdiv(60)
      x = chroma * (1 - (hue_prime % 2 - 1).abs)

      case hue_prime
      when (0...1) then [chroma, x, 0]
      when (1...2) then [x, chroma, 0]
      when (2...3) then [0, chroma, x]
      when (3...4) then [0, x, chroma]
      when (4...5) then [x, 0, chroma]
      when (5..6)  then [chroma, 0, x]
      end
    end
def cylindrical_to_cubic(hue, saturation, y_component, chroma)
      hue_prime = hue.fdiv(60)
      x = chroma * (1 - (hue_prime % 2 - 1).abs)

      case hue_prime
      when (0...1) then [chroma, x, 0]
      when (1...2) then [x, chroma, 0]
      when (2...3) then [0, chroma, x]
      when (3...4) then [0, x, chroma]
      when (4...5) then [x, 0, chroma]
      when (5..6)  then [chroma, 0, x]
      end
    end
Convert one HSL or HSV triple and associated chroma to a scaled rgb triple

 This method encapsulates the shared mathematical operations needed to
 convert coordinates from a cylindrical colorspace such as HSL or HSV into
 coordinates of the RGB colorspace.

 Even though chroma values are derived from the other three coordinates,
 the formula for calculating chroma differs for each colorspace.  Since it
 is calculated differently for each colorspace, it must be passed in as
 a parameter.

 @param [Fixnum] hue The hue-component (0-360)
 @param [Fixnum] saturation The saturation-component (0-1)
 @param [Fixnum] y_component The y_component can represent either lightness
     or brightness/value (0-1) depending on which scheme (HSV/HSL) is being used.
 @param [Fixnum] chroma The associated chroma value.
 @return [Array<Fixnum>] A scaled r,g,b triple. Scheme-dependent
    adjustments are still needed to reach the true r,g,b values.
 @see http://en.wikipedia.org/wiki/HSL_and_HSV
 @see http://www.tomjewett.com/colors/hsb.html
 @private