Module | Prawn::Graphics::Color |
In: |
lib/prawn/graphics/color.rb
|
COLOR_SPACES | = | [:DeviceRGB, :DeviceCMYK, :Pattern] |
Sets or returns the fill color.
When called with no argument, it returns the current 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
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 fill_and_stroke_some_method(*args) #=> some_method(*args); fill_and_stroke
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 or returns the line stroking color.
When called with no argument, it returns the current stroking color.
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