Method: RBPDF#RadialGradient
- Defined in:
- lib/rbpdf.rb
#RadialGradient(x, y, w, h, col1 = [], col2 = [], coords = [0.5,0.5,0.5,0.5,1]) ⇒ Object Also known as: radial_gradient
Paints a radial colour gradient.
- @param float :x
-
abscissa of the top left corner of the rectangle.
- @param float :y
-
ordinate of the top left corner of the rectangle.
- @param float :w
-
width of the rectangle.
- @param float :h
-
height of the rectangle.
- @param array :col1
-
first color (Grayscale, RGB or CMYK components).
- @param array :col2
-
second color (Grayscale, RGB or CMYK components).
- @param array :coords
-
array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined.
- @since 3.1.000 (2008-06-09)
- @access public
11776 11777 11778 11779 |
# File 'lib/rbpdf.rb', line 11776 def RadialGradient(x, y, w, h, col1=[], col2=[], coords=[0.5,0.5,0.5,0.5,1]) Clip(x, y, w, h) Gradient(3, coords, [{'color' => col1, 'offset' => 0, 'exponent' => 1}, {'color' => col2, 'offset' => 1, 'exponent' => 1}], [], false) end |