Rainbow::Color::RGB

Attributes

b[R]
g[R]
r[R]

Public Class Methods

new(ground, *values) click to toggle source
# File lib/rainbow/color.rb, line 91
def initialize(ground, *values)
  if values.min < 0 || values.max > 255
    fail ArgumentError, "RGB value outside 0-255 range"
  end

  super(ground, 8)
  @r, @g, @b = values
end
to_ansi_domain(value) click to toggle source
# File lib/rainbow/color.rb, line 87
def self.to_ansi_domain(value)
  (6 * (value / 256.0)).to_i
end

Public Instance Methods

codes() click to toggle source
# File lib/rainbow/color.rb, line 100
def codes
  super + [5, code_from_rgb]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.