Class | Color::HSL |
In: |
lib/color/hsl.rb
|
Parent: | Object |
An HSL colour object. Internally, the hue (h), saturation (s), and luminosity (l) values are dealt with as fractional values in the range 0..1.
h | [RW] | |
l | [RW] | |
s | [RW] |
Creates an HSL colour object from the standard values of degrees and percentages (e.g., 145º, 30%, 50%).
Compares the other colour to this one. The other colour will be converted to HSL before comparison, so the comparison between a HSL colour and a non-HSL colour will be approximate and based on the other colour‘s to_hsl conversion. If there is no to_hsl conversion, this will raise an exception. This will report that two HSL values are equivalent if all component values are within 1e-4 (0.0001) of each other.
Converting to HSL as adapted from Foley and Van-Dam from www.bobpowell.net/RGBHSB.htm.