Class: MotionPlot::AreaGradient
- Inherits:
-
Object
- Object
- MotionPlot::AreaGradient
- Defined in:
- lib/motion-plot/utilities/area_gradient.rb
Instance Attribute Summary collapse
-
#angle ⇒ Object
Returns the value of attribute angle.
Instance Method Summary collapse
- #fill_with(color) ⇒ Object
-
#initialize(orientation) ⇒ AreaGradient
constructor
A new instance of AreaGradient.
Constructor Details
#initialize(orientation) ⇒ AreaGradient
Returns a new instance of AreaGradient.
6 7 8 |
# File 'lib/motion-plot/utilities/area_gradient.rb', line 6 def initialize(orientation) @angle = (orientation == "vertical") ? 0.0 : -90.0 end |
Instance Attribute Details
#angle ⇒ Object
Returns the value of attribute angle.
4 5 6 |
# File 'lib/motion-plot/utilities/area_gradient.rb', line 4 def angle @angle end |
Instance Method Details
#fill_with(color) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/motion-plot/utilities/area_gradient.rb', line 10 def fill_with(color) gradient = CPTGradient.gradientWithBeginningColor(color, endingColor:CPTColor.clearColor) gradient.angle = @angle CPTFill.fillWithGradient(gradient) end |