def from_hsl(hue, saturation, lightness, alpha = 255)
      raise ArgumentError, "Hue #{hue} was not between 0 and 360" unless (0..360).cover?(hue)
      raise ArgumentError, "Saturation #{saturation} was not between 0 and 1" unless (0..1).cover?(saturation)
      raise ArgumentError, "Lightness #{lightness} was not between 0 and 1" unless (0..1).cover?(lightness)

      chroma = (1 - (2 * lightness - 1).abs) * saturation
      rgb    = cylindrical_to_cubic(hue, saturation, lightness, chroma)
      rgb.map! { |component| ((component + lightness - 0.5 * chroma) * 255).to_i }
      rgb << alpha
      rgba(*rgb)
    end
def from_hsl(hue, saturation, lightness, alpha = 255)
      raise ArgumentError, "Hue #{hue} was not between 0 and 360" unless (0..360).cover?(hue)
      raise ArgumentError, "Saturation #{saturation} was not between 0 and 1" unless (0..1).cover?(saturation)
      raise ArgumentError, "Lightness #{lightness} was not between 0 and 1" unless (0..1).cover?(lightness)

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

 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] lightness The lightness component (0-1)
 @param [Fixnum] alpha Defaults to opaque (255).
 @return [Integer] The newly constructed color value.
 @raise [ArgumentError] if the hsl triple is invalid.
 @see http://en.wikipedia.org/wiki/HSL_and_HSV