In Files

Parent

Sickill::Rainbow::RGB

Helper class for RGB color format.

Public Class Methods

outside_range?(rgb) click to toggle source
# File lib/ansi_rgb.rb, line 32
def self.outside_range?(rgb)
  rgb.min < 0 or rgb.max > 255
end
to_ansi_domain(value) click to toggle source

Change domain of color value from 0-255 to 0-5

# File lib/ansi_rgb.rb, line 37
def self.to_ansi_domain(value)
  (6 * (value / 256.0)).to_i
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.