Module Prawn::Graphics::Color
In: lib/prawn/graphics/color.rb

Methods

Public Instance methods

Sets the fill color.

If a single argument is provided, it should be a 6 digit HTML color code.

  pdf.fill_color "f0ffc1"

If 4 arguments are provided, the color is assumed to be a CMYK value Values range from 0 - 100.

  pdf.fill_color 0, 99, 95, 0
fill_color=(*color)

Alias for fill_color

Converts hex string into RGB value array:

 >> Prawn::Graphics::Color.hex2rgb("ff7808")
 => [255, 120, 8]

Provides the following shortcuts:

   stroke_some_method(*args) #=> some_method(*args); stroke
   fill_some_method(*args) #=> some_method(*args); fill

Converts RGB value array to hex string suitable for use with fill_color and stroke_color

  >> Prawn::Graphics::Color.rgb2hex([255,120,8])
  => "ff7808"

Sets the line stroking color. 6 digit HTML color codes are used.

If a single argument is provided, it should be a 6 digit HTML color code.

  pdf.fill_color "f0ffc1"

If 4 arguments are provided, the color is assumed to be a CMYK value Values range from 0 - 100.

  pdf.fill_color 0, 99, 95, 0
stroke_color=(*color)

Alias for stroke_color

[Validate]