Class: Rainbow::Color
- Inherits:
-
Object
- Object
- Rainbow::Color
- Defined in:
- lib/rainbow/color.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
- #b ⇒ Object
- #g ⇒ Object
-
#initialize(color, location) ⇒ Color
constructor
color - Fixnum location - Fixnum (0-100).
- #r ⇒ Object
Constructor Details
#initialize(color, location) ⇒ Color
color - Fixnum location - Fixnum (0-100)
7 8 9 10 11 12 |
# File 'lib/rainbow/color.rb', line 7 def initialize(color, location) @color = color @location = location assert_location! end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
3 4 5 |
# File 'lib/rainbow/color.rb', line 3 def color @color end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
3 4 5 |
# File 'lib/rainbow/color.rb', line 3 def location @location end |
Instance Method Details
#b ⇒ Object
22 23 24 |
# File 'lib/rainbow/color.rb', line 22 def b ChunkyPNG::Color.b(color) end |
#g ⇒ Object
18 19 20 |
# File 'lib/rainbow/color.rb', line 18 def g ChunkyPNG::Color.g(color) end |
#r ⇒ Object
14 15 16 |
# File 'lib/rainbow/color.rb', line 14 def r ChunkyPNG::Color.r(color) end |