Class: RColor
- Inherits:
-
Object
- Object
- RColor
- Defined in:
- lib/command_handlers/models/r_color.rb
Instance Attribute Summary collapse
-
#alpha ⇒ Object
readonly
Returns the value of attribute alpha.
-
#blue ⇒ Object
readonly
Returns the value of attribute blue.
-
#display ⇒ Object
Returns the value of attribute display.
-
#green ⇒ Object
readonly
Returns the value of attribute green.
-
#red ⇒ Object
readonly
Returns the value of attribute red.
Class Method Summary collapse
Instance Method Summary collapse
- #color ⇒ Object
-
#initialize(display, red, green, blue, alpha = nil) ⇒ RColor
constructor
A new instance of RColor.
Constructor Details
#initialize(display, red, green, blue, alpha = nil) ⇒ RColor
Returns a new instance of RColor.
16 17 18 19 20 21 22 |
# File 'lib/command_handlers/models/r_color.rb', line 16 def initialize(display, red, green, blue, alpha = nil) @display = display @red = red @green = green @blue = blue @alpha = alpha end |
Instance Attribute Details
#alpha ⇒ Object (readonly)
Returns the value of attribute alpha.
4 5 6 |
# File 'lib/command_handlers/models/r_color.rb', line 4 def alpha @alpha end |
#blue ⇒ Object (readonly)
Returns the value of attribute blue.
4 5 6 |
# File 'lib/command_handlers/models/r_color.rb', line 4 def blue @blue end |
#display ⇒ Object
Returns the value of attribute display.
4 5 6 |
# File 'lib/command_handlers/models/r_color.rb', line 4 def display @display end |
#green ⇒ Object (readonly)
Returns the value of attribute green.
4 5 6 |
# File 'lib/command_handlers/models/r_color.rb', line 4 def green @green end |
#red ⇒ Object (readonly)
Returns the value of attribute red.
4 5 6 |
# File 'lib/command_handlers/models/r_color.rb', line 4 def red @red end |
Class Method Details
.for(display, standard_color) ⇒ Object
11 12 13 |
# File 'lib/command_handlers/models/r_color.rb', line 11 def for(display, standard_color) display.getSystemColor(RSwt[standard_color]) end |
Instance Method Details
#color ⇒ Object
24 25 26 |
# File 'lib/command_handlers/models/r_color.rb', line 24 def color @color ||= Color.new(@display, *[@red, @green, @blue, @alpha].compact) end |