Module | Color |
In: |
lib/color.rb
lib/color/grayscale.rb |
COLOR_VERSION | = | '1.4.1' | ||
COLOR_EPSILON | = | 1e-5 | The maximum "resolution" for colour math; if any value is less than or equal to this value, it is treated as zero. | |
COLOR_TOLERANCE | = | 1e-4 | The tolerance for comparing the components of two colours. In general, colours are considered equal if all of their components are within this tolerance value of each other. | |
GreyScale | = | GrayScale | A synonym for Color::GrayScale. |
normalize | -> | normalize_fractional |
normalize_byte | -> | normalize_8bit |
normalize_word | -> | normalize_16bit |
Provides a thin veneer over the Color module to make it seem like this is Color 0.1.0 (a class) and not Color 1.4.1 (a module). This "constructor" will be removed in the future.
mode = :hsl: | values must be an array of [ hue deg, sat %, lum % ]. A Color::HSL object will be created. |
mode = :rgb: | values will either be an HTML-style colour string or an array of [ red, green, blue ] (range 0 .. 255). A Color::RGB object will be created. |
mode = :cmyk: | values must be an array of [ cyan %, magenta %, yellow %, black % ]. A Color::CMYK object will be created. |