Class: Rainbow::Color::RGB

### Home Classes Methods

### In Files

- lib/rainbow/color.rb

### Parent

Rainbow::Color::Indexed

### Methods

- ::new
- ::to_ansi_domain
- #codes

### Class/Module Index

Quicksearch

- Rainbow
- Rainbow::Color
- Rainbow::Color::Indexed
- Rainbow::Color::Named
- Rainbow::Color::RGB
- Rainbow::Ext
- Rainbow::Ext::String
- Rainbow::Ext::String::InstanceMethods
- Rainbow::NullPresenter
- Rainbow::Presenter
- Rainbow::StringUtils
- Rainbow::Wrapper
- Sickill
- Sickill::Rainbow
- Object

No matching classes.

# 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.