Class: RubyPost::Colour
Overview
wrapper for the metapost withcolor command Except colour is now spelt correctly.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#b ⇒ Object
readonly
Returns the value of attribute b.
-
#g ⇒ Object
readonly
Returns the value of attribute g.
-
#r ⇒ Object
readonly
Returns the value of attribute r.
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(r = 0, g = 0, b = 0) ⇒ Colour
constructor
A new instance of Colour.
Constructor Details
#initialize(r = 0, g = 0, b = 0) ⇒ Colour
Returns a new instance of Colour.
38 39 40 41 42 |
# File 'lib/options.rb', line 38 def initialize(r=0,g=0,b=0) @r = r @g = g @b = b end |
Instance Attribute Details
#b ⇒ Object (readonly)
Returns the value of attribute b.
36 37 38 |
# File 'lib/options.rb', line 36 def b @b end |
#g ⇒ Object (readonly)
Returns the value of attribute g.
35 36 37 |
# File 'lib/options.rb', line 35 def g @g end |
#r ⇒ Object (readonly)
Returns the value of attribute r.
34 35 36 |
# File 'lib/options.rb', line 34 def r @r end |
Instance Method Details
#compile ⇒ Object
44 45 46 |
# File 'lib/options.rb', line 44 def compile 'withcolor' + '(' + @r.to_s + ',' + @g.to_s + ',' + @b.to_s + ')' end |