Module: Prawn::Graphics::Patterns

Included in:
Prawn::Graphics
Defined in:
lib/prawn/graphics/patterns.rb

Stable API (collapse)

Instance Method Details

- (Object) fill_gradient(*args)

Sets the fill gradient from color1 to color2. old arguments: point, width, height, color1, color2, options = {} new arguments: from, to, color1, color1, options = {}

or  from, r1, to, r2, color1, color2, options = {}

Option :apply_transformations, if set true, will transform the gradient's co-ordinate space so it matches the current co-ordinate space of the document. This option will be the default from Prawn v3. The current default, false, will mean if you (for example) scale your document by 2 and put a gradient inside, you will have to manually multiply your co-ordinates by 2 so the gradient is correctly positioned.



26
27
28
# File 'lib/prawn/graphics/patterns.rb', line 26

def fill_gradient(*args)
  set_gradient(:fill, *args)
end

- (Object) stroke_gradient(*args)

Sets the stroke gradient from color1 to color2. old arguments: point, width, height, color1, color2, options = {} new arguments: from, to, color1, color2, options = {}

or  from, r1, to, r2, color1, color2, options = {}

Option :apply_transformations, if set true, will transform the gradient's co-ordinate space so it matches the current co-ordinate space of the document. This option will be the default from Prawn v3. The current default, false, will mean if you (for example) scale your document by 2 and put a gradient inside, you will have to manually multiply your co-ordinates by 2 so the gradient is correctly positioned.



41
42
43
# File 'lib/prawn/graphics/patterns.rb', line 41

def stroke_gradient(*args)
  set_gradient(:stroke, *args)
end