Class: RubyPost::Colour

Inherits:
Option show all
Defined in:
lib/options.rb

Overview

wrapper for the metapost withcolor command Except colour is now spelt correctly.

Direct Known Subclasses

Color

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bObject (readonly)

Returns the value of attribute b.



36
37
38
# File 'lib/options.rb', line 36

def b
  @b
end

#gObject (readonly)

Returns the value of attribute g.



35
36
37
# File 'lib/options.rb', line 35

def g
  @g
end

#rObject (readonly)

Returns the value of attribute r.



34
35
36
# File 'lib/options.rb', line 34

def r
  @r
end

Instance Method Details

#compileObject



44
45
46
# File 'lib/options.rb', line 44

def compile
  'withcolor' + '(' + @r.to_s + ',' + @g.to_s + ',' + @b.to_s + ')'
end