Sha256: a72872c242ea81d56f7cfe0272e91051cc191267d56b15d5f3f42b5d52d48dcb

Contents?: true

Size: 695 Bytes

Versions: 8

Compression:

Stored size: 695 Bytes

Contents

# encoding: utf-8
#
# We can change the stroke and fill colors providing an HTML rgb 6 digit color
# code string ("AB1234") or 4 values for CMYK.
#
require File.expand_path(File.join(File.dirname(__FILE__),
                                   %w[.. example_helper]))

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::Example.generate(filename) do
  stroke_axis
  
  # Fill with Yellow using RGB
  fill_color "FFFFCC"
  fill_polygon [50, 150], [150, 200], [250, 150],
               [250, 50], [150, 0], [50, 50]
  
  # Stroke with Purple using CMYK
  stroke_color 50, 100, 0, 0
  stroke_rectangle [300, 300], 200, 100
  
  # Both together
  fill_and_stroke_circle [400, 100], 50
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
prawn-1.0.0 manual/graphics/color.rb
prawn-0.15.0 manual/graphics/color.rb
prawn-0.14.0 manual/graphics/color.rb
prawn-0.13.2 manual/graphics/color.rb
prawn-0.13.1 manual/graphics/color.rb
prawn-0.13.0 manual/graphics/color.rb
prawn-1.0.0.rc2 manual/graphics/color.rb
nurettin-prawn-1.0.0.rc1 manual/graphics/color.rb