Class: Sickill::Rainbow::RGB

### Home Classes Methods

### In Files

- lib/ansi_rgb.rb

### Parent

Object

### Methods

- ::outside_range?
- ::to_ansi_domain

### Class/Module Index

Quicksearch

- Sickill
- Sickill::Rainbow
- Sickill::Rainbow::AnsiColor
- Sickill::Rainbow::AnsiRgb
- Sickill::Rainbow::RGB

No matching classes.

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