Class: Quartz::Shading
- Inherits:
-
Object
- Object
- Quartz::Shading
- Defined in:
- lib/rubyquartz/shading.rb
Instance Attribute Summary collapse
-
#function ⇒ Object
readonly
Returns the value of attribute function.
Instance Method Summary collapse
-
#initialize(function, options = {}) ⇒ Shading
constructor
A new instance of Shading.
Constructor Details
#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 |
Instance Attribute Details
#function ⇒ Object (readonly)
Returns the value of attribute function.
28 29 30 |
# File 'lib/rubyquartz/shading.rb', line 28 def function @function end |