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

### Methods

fill_color fill_color= hex2rgb method_missing rgb2hex stroke_color stroke_color=

### Public Instance methods

fill_color(*color)

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

hex2rgb(hex)

Converts hex string into RGB value array:

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

method_missing(id,*args,&block)

Provides the following shortcuts:

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

rgb2hex(rgb)

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

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

stroke_color(*color)

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.stroke_color "f0ffc1"

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

      pdf.stroke_color 0, 99, 95, 0

stroke_color=(*color)

Alias for stroke_color

[Validate]