Method: RBPDF#SetTextColorArray
- Defined in:
- lib/rbpdf.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()
2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 |
# File 'lib/rbpdf.rb', line 2411 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 |