Class: Gradient::Point
- Inherits:
-
Object
- Object
- Gradient::Point
- Defined in:
- lib/gradient/point.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#opacity ⇒ Object
readonly
Returns the value of attribute opacity.
Instance Method Summary collapse
-
#initialize(location, color, opacity) ⇒ Point
constructor
A new instance of Point.
- #inspect ⇒ Object
Constructor Details
#initialize(location, color, opacity) ⇒ Point
Returns a new instance of Point.
6 7 8 |
# File 'lib/gradient/point.rb', line 6 def initialize(location, color, opacity) @location, @color, @opacity = location, color, opacity end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
4 5 6 |
# File 'lib/gradient/point.rb', line 4 def color @color end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
4 5 6 |
# File 'lib/gradient/point.rb', line 4 def location @location end |
#opacity ⇒ Object (readonly)
Returns the value of attribute opacity.
4 5 6 |
# File 'lib/gradient/point.rb', line 4 def opacity @opacity end |
Instance Method Details
#inspect ⇒ Object
10 11 12 |
# File 'lib/gradient/point.rb', line 10 def inspect "#<Point #{location * 100} ##{color.hex}#{"%02x" % (opacity * 255).round}>" end |