Class: Graphit::Color
- Inherits:
-
Object
- Object
- Graphit::Color
- Defined in:
- lib/graphit/color.rb
Instance Attribute Summary collapse
-
#blue ⇒ Object
Returns the value of attribute blue.
-
#green ⇒ Object
Returns the value of attribute green.
-
#red ⇒ Object
0 - 255.
Class Method Summary collapse
- .black_color ⇒ Object
- .blue_color ⇒ Object
- .green_color ⇒ Object
- .light_gray_color ⇒ Object
- .light_light_gray_color ⇒ Object
- .medium_gray_color ⇒ Object
- .red_color ⇒ Object
- .white_color ⇒ Object
Instance Method Summary collapse
-
#initialize(red, green, blue) ⇒ Color
constructor
A new instance of Color.
- #to_hex_array ⇒ Object
Constructor Details
#initialize(red, green, blue) ⇒ Color
Returns a new instance of Color.
9 10 11 12 13 |
# File 'lib/graphit/color.rb', line 9 def initialize( red, green, blue ) self.red = red self.green = green self.blue = blue end |
Instance Attribute Details
#blue ⇒ Object
Returns the value of attribute blue.
7 8 9 |
# File 'lib/graphit/color.rb', line 7 def blue @blue end |
#green ⇒ Object
Returns the value of attribute green.
6 7 8 |
# File 'lib/graphit/color.rb', line 6 def green @green end |
#red ⇒ Object
0 - 255
5 6 7 |
# File 'lib/graphit/color.rb', line 5 def red @red end |
Class Method Details
.black_color ⇒ Object
35 36 37 |
# File 'lib/graphit/color.rb', line 35 def self.black_color Graphit::Color.new( 0, 0, 0 ) end |
.blue_color ⇒ Object
43 44 45 |
# File 'lib/graphit/color.rb', line 43 def self.blue_color Graphit::Color.new( 0, 0, 255 ) end |
.green_color ⇒ Object
47 48 49 |
# File 'lib/graphit/color.rb', line 47 def self.green_color Graphit::Color.new( 0, 255, 0 ) end |
.light_gray_color ⇒ Object
23 24 25 |
# File 'lib/graphit/color.rb', line 23 def self.light_gray_color Graphit::Color.new( 204, 204, 204 ) end |
.light_light_gray_color ⇒ Object
19 20 21 |
# File 'lib/graphit/color.rb', line 19 def self.light_light_gray_color Graphit::Color.new( 225, 225, 225 ) end |
.medium_gray_color ⇒ Object
27 28 29 |
# File 'lib/graphit/color.rb', line 27 def self.medium_gray_color Graphit::Color.new( 170, 170, 170 ) end |
.red_color ⇒ Object
39 40 41 |
# File 'lib/graphit/color.rb', line 39 def self.red_color Graphit::Color.new( 255, 0, 0 ) end |
.white_color ⇒ Object
31 32 33 |
# File 'lib/graphit/color.rb', line 31 def self.white_color Graphit::Color.new( 255, 255, 255 ) end |
Instance Method Details
#to_hex_array ⇒ Object
15 16 17 |
# File 'lib/graphit/color.rb', line 15 def to_hex_array [blue,green,red] end |