Class: Rainbow::Opacity
- Inherits:
-
Object
- Object
- Rainbow::Opacity
- Defined in:
- lib/rainbow/opacity.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value, location) ⇒ Opacity
constructor
value - Fixnum (0-100) location - Fixnum (0-100).
Constructor Details
#initialize(value, location) ⇒ Opacity
value - Fixnum (0-100) location - Fixnum (0-100)
8 9 10 11 12 13 14 |
# File 'lib/rainbow/opacity.rb', line 8 def initialize(value, location) @value_percentage = value @value = (255.0 * value / 100).round @location = location assert_arguments! end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
4 5 6 |
# File 'lib/rainbow/opacity.rb', line 4 def location @location end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/rainbow/opacity.rb', line 4 def value @value end |