class Color
author Dennis Cosgrove
Constants
- ALIZARAN_CRIMSON
- AQUAMARINE
- BAMBOO
- BARBIE_PINK
- BLACK
- BLUE
- BRIGHT_SPARK
- CAPRI
- CARMINE
- CYAN
- DODGER_BLUE
- FRENCH_VIOLET
- GAMBAGE
- GREEN
- HONOLULU_BLUE
- JAZZBERRY_JAM
- JEEPERS_CREEPERS
- MAGENTA
- OCEAN_GREEN
- OUTRAGEOUS_ORANGE
- PARIS_DAISY
- PLUM
- RED
- SUMMER_SKY
- WHITE
- YELLOW
Attributes
blue[R]
green[R]
red[R]
Public Class Methods
from_unsigned_bytes(red, green, blue)
click to toggle source
@param red [Integer] @param green [Integer] @param blue [Integer]
# File ../../../../../425-dev/src/core/ruby/render/core/color.rb, line 22 def self.from_unsigned_bytes(red, green, blue) Color.new(red / 255.0, green / 255.0, blue / 255.0) end
new(red, green, blue)
click to toggle source
@param red [Float] @param green [Float] @param blue [Float]
# File ../../../../../425-dev/src/core/ruby/render/core/color.rb, line 12 def initialize(red, green, blue) @red = red @green = green @blue = blue end
Public Instance Methods
==(other)
click to toggle source
# File ../../../../../425-dev/src/core/ruby/render/core/color.rb, line 26 def ==(other) if other.is_a?(Color) @red == other.red && @green == other.green && @blue == other.blue else false end end
eq?(other)
click to toggle source
# File ../../../../../425-dev/src/core/ruby/render/core/color.rb, line 34 def eq?(other) self == other end
hash()
click to toggle source
# File ../../../../../425-dev/src/core/ruby/render/core/color.rb, line 38 def hash [@red, @green, @blue].hash end
to_ary()
click to toggle source
# File ../../../../../425-dev/src/core/ruby/render/core/color.rb, line 42 def to_ary [@red, @green, @blue] end
to_s()
click to toggle source
# File ../../../../../425-dev/src/core/ruby/render/core/color.rb, line 46 def to_s "#{self.class.name}[#{@red}, #{@green}, #{@blue}]" end