Class: PREP::Core::Color
- Inherits:
-
Object
- Object
- PREP::Core::Color
- Defined in:
- lib/core/color.rb
Overview
nodoc
Instance Attribute Summary collapse
-
#blue ⇒ Object
Returns the value of attribute blue.
-
#green ⇒ Object
Returns the value of attribute green.
-
#red ⇒ Object
Returns the value of attribute red.
Instance Method Summary collapse
-
#initialize(red, green, blue) ⇒ Color
constructor
A new instance of Color.
-
#white? ⇒ Boolean
全ての色設定が 255 の場合は白として扱う.
Constructor Details
#initialize(red, green, blue) ⇒ Color
Returns a new instance of Color.
11 12 13 14 15 |
# File 'lib/core/color.rb', line 11 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.
9 10 11 |
# File 'lib/core/color.rb', line 9 def blue @blue end |
#green ⇒ Object
Returns the value of attribute green.
9 10 11 |
# File 'lib/core/color.rb', line 9 def green @green end |
#red ⇒ Object
Returns the value of attribute red.
9 10 11 |
# File 'lib/core/color.rb', line 9 def red @red end |
Instance Method Details
#white? ⇒ Boolean
全ての色設定が 255 の場合は白として扱う
18 19 20 |
# File 'lib/core/color.rb', line 18 def white? return red == 1.0 && green == 1.0 && blue == 1.0 end |