Method: RBPDF#SetDrawColorArray

Defined in:
lib/rbpdf.rb

#SetDrawColorArray(color) ⇒ Object Also known as: set_draw_color_array

Defines the color used for all drawing operations (lines, rectangles and cell borders). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.

@param array or ordered hash :color

array(or ordered hash) of colors

@access public
@since 3.1.000 (2008-6-11)
@see

SetDrawColor()



2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
# File 'lib/rbpdf.rb', line 2259

def SetDrawColorArray(color)
  if !color.nil?
    color = color.values if color.is_a? Hash
    r = !color[0].nil? ? color[0] : -1
    g = !color[1].nil? ? color[1] : -1
    b = !color[2].nil? ? color[2] : -1
    k = !color[3].nil? ? color[3] : -1
    if r >= 0
      SetDrawColor(r, g, b, k)
    end
  end
end