Class | Color::HSL |
In: |
lib/color/hsl.rb
|
Parent: | Object |
Creates an HSL colour object from the standard values of degrees and percentages (e.g., 145 deg, 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 Color::COLOR_TOLERANCE of each other.
Present the colour as an HSLA (with alpha) HTML/CSS colour string (e.g., "hsla(180, 25%, 35%, 1)").
Sets the hue of the colour in degrees. Colour is perceived as a wheel, so values should be set properly even with negative degree values.
Mix the mask colour (which will be converted to an HSL colour) with the current colour at the stated mix percentage as a decimal value.
NOTE: | This differs from Color::RGB#mix_with. |
Converting to HSL as adapted from Foley and Van-Dam from www.bobpowell.net/RGBHSB.htm.
NOTE: