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.
| Public Methods |
| == |
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.
|
| brightness |
Returns the luminosity (#l) of the colour.
|
| from_fraction |
Creates an HSL colour object from fractional values 0..1.
|
| h= |
|
| html |
Present the colour as an HTML/CSS colour string.
|
| l= |
|
| new |
Creates an HSL colour object from the standard values of degrees and
percentages (e.g., 145º, 30%, 50%).
|
| s= |
|
| to_cmyk |
Converts to RGB then CMYK.
|
| to_grayscale |
Alias for #to_greyscale
|
| to_greyscale |
|
| to_rgb |
Converting to HSL as adapted from Foley and Van-Dam from www.bobpowell.net/RGBHSB.htm.
|
| to_yiq |
Converts to RGB then YIQ.
|
<code/>and<pre/>for code samples.