Method: Quartz::Shading#initialize
- Defined in:
- lib/rubyquartz/shading.rb
#initialize(function, options = {}) ⇒ Shading
Returns a new instance of Shading.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rubyquartz/shading.rb', line 30 def initialize(function, ={}) type = [:type] || :axial case type when :axial @function = function # Hold onto this so it doesn't get GC'd colorspace = [:colorspace] || ColorSpace.new(:name => ColorSpace::GENERIC_RGB) start_point = [:start] || Point.new(0, 0) end_point = [:end] || Point.new(1, 0) extend_start = [:extend_start] || false extend_end = [:extend_end] || false _initialize_axial(colorspace, start_point.x, start_point.y, end_point.x, end_point.y, function, extend_start, extend_end) else raise "Unknown shading type '#{type}'" end end |