Method: RBPDF#LinearGradient
- Defined in:
- lib/rbpdf.rb
#LinearGradient(x, y, w, h, col1 = [], col2 = [], coords = [0,0,1,0]) ⇒ Object Also known as: linear_gradient
Paints a linear 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 (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0).
- @since 3.1.000 (2008-06-09)
- @access public
11758 11759 11760 11761 |
# File 'lib/rbpdf.rb', line 11758 def LinearGradient(x, y, w, h, col1=[], col2=[], coords=[0,0,1,0]) Clip(x, y, w, h) Gradient(2, coords, [{'color' => col1, 'offset' => 0, 'exponent' => 1}, {'color' => col2, 'offset' => 1, 'exponent' => 1}], [], false) end |