Method: TCPDF#SetTextColorArray

Defined in:
lib/tcpdf.rb

#SetTextColorArray(color) ⇒ Object Also known as: set_text_color_array

Defines the color used for text. 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

SetFillColor()



2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
# File 'lib/tcpdf.rb', line 2324

def SetTextColorArray(color)
  unless 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
      SetTextColor(r, g, b, k)
    end
  end
end