Class: MotionPlot::AreaGradient

Inherits:
Object
  • Object
show all
Defined in:
lib/motion-plot/utilities/area_gradient.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#angleObject

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