Class: MapSource::Color
- Inherits:
-
Object
- Object
- MapSource::Color
- Defined in:
- lib/mapsource/defs.rb
Overview
Public: A Color attributed to a Track, Route or Waypoint.
Instance Attribute Summary collapse
-
#b ⇒ Object
readonly
Returns the value of attribute b.
-
#g ⇒ Object
readonly
Returns the value of attribute g.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#r ⇒ Object
readonly
Returns the value of attribute r.
Class Method Summary collapse
-
.from_index(idx) ⇒ Object
Public: Converts GDB color index to color object.
Instance Method Summary collapse
-
#initialize(name, r = -1,, g = -1,, b = -1)) ⇒ Color
constructor
A new instance of Color.
Constructor Details
#initialize(name, r = -1,, g = -1,, b = -1)) ⇒ Color
Returns a new instance of Color.
6 7 8 9 10 11 |
# File 'lib/mapsource/defs.rb', line 6 def initialize(name, r=-1, g=-1, b=-1) @name = name @r = @r @g = @g @b = @b end |
Instance Attribute Details
#b ⇒ Object (readonly)
Returns the value of attribute b.
4 5 6 |
# File 'lib/mapsource/defs.rb', line 4 def b @b end |
#g ⇒ Object (readonly)
Returns the value of attribute g.
4 5 6 |
# File 'lib/mapsource/defs.rb', line 4 def g @g end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/mapsource/defs.rb', line 4 def name @name end |
#r ⇒ Object (readonly)
Returns the value of attribute r.
4 5 6 |
# File 'lib/mapsource/defs.rb', line 4 def r @r end |