Sha256: c0c3d45cc090a9e6a6552eec0281a419973bf13958bb206580ecb66f101a7a25

Contents?: true

Size: 668 Bytes

Versions: 2

Compression:

Stored size: 668 Bytes

Contents

# encoding: utf-8
#
# The <code>:color</code> attribute can give a block of text a default color,
# in RGB hex format or 4-value CMYK.
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::ManualBuilder::Example.generate(filename) do
  text "Default color is black"
  move_down 25

  text "Changed to red", :color => "FF0000"
  move_down 25

  text "CMYK color", :color => [22, 55, 79, 30]
  move_down 25

  text "Also works with <color rgb='ff0000'>inline</color> formatting",
       :color => "0000FF",
       :inline_format => true
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
prawn-2.1.0 manual/text/color.rb
prawn-2.0.2 manual/text/color.rb