Class: Svg::RGB
- Inherits:
-
Object
- Object
- Svg::RGB
- Defined in:
- lib/svg.rb
Instance Method Summary collapse
- #blue ⇒ Object
- #green ⇒ Object
-
#initialize(r = 0, g = 0, b = 0) ⇒ RGB
constructor
A new instance of RGB.
- #red ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(r = 0, g = 0, b = 0) ⇒ RGB
Returns a new instance of RGB.
8 9 10 11 12 |
# File 'lib/svg.rb', line 8 def initialize(r=0, g=0, b=0) @red = r @green = g @blue = b end |
Instance Method Details
#blue ⇒ Object
19 20 21 |
# File 'lib/svg.rb', line 19 def blue @blue end |
#green ⇒ Object
16 17 18 |
# File 'lib/svg.rb', line 16 def green @green end |
#red ⇒ Object
13 14 15 |
# File 'lib/svg.rb', line 13 def red @red end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/svg.rb', line 22 def to_s return "rgb(#{@red},#{@green},#{@blue})" end |