Class: Sickill::Rainbow::RGB
- Inherits:
-
Object
- Object
- Sickill::Rainbow::RGB
- Defined in:
- lib/ansi_rgb.rb
Overview
Helper class for RGB color format.
Class Method Summary collapse
- .outside_range?(rgb) ⇒ Boolean
-
.to_ansi_domain(value) ⇒ Object
Change domain of color value from 0-255 to 0-5.
Class Method Details
.outside_range?(rgb) ⇒ Boolean
32 33 34 |
# File 'lib/ansi_rgb.rb', line 32 def self.outside_range?(rgb) rgb.min < 0 or rgb.max > 255 end |
.to_ansi_domain(value) ⇒ Object
Change domain of color value from 0-255 to 0-5
37 38 39 |
# File 'lib/ansi_rgb.rb', line 37 def self.to_ansi_domain(value) (6 * (value / 256.0)).to_i end |