Sha256: cddebdd4bf3ac0cca84c20586f74be17f24722185f16cec640f4075cd6a0b462

Contents?: true

Size: 638 Bytes

Versions: 20

Compression:

Stored size: 638 Bytes

Contents

# encoding: utf-8
#
# Demonstrate use of transparency
#
require "#{File.dirname(__FILE__)}/../example_helper.rb"

Prawn::Document.generate("transparency.pdf") do
  fill_color("ff0000")
  fill_circle_at([200, 200], :radius => 200)
  transparent(0.5, 1) do
    fill_color("000000")
    stroke_color("ffffff")
    fill_and_stroke_circle_at([300, 300], :radius => 200)
    fill_color("ffffff")
    text "transparency " * 150, :size => 18
  end
  
  start_new_page

  fill_color("000000")
  fill_rectangle([0, bounds.top], 200, 100)
  transparent(0.5) do
    fill_color("ff0000")
    fill_rectangle([100, bounds.top - 50], 200, 100)
  end
end

Version data entries

20 entries across 20 versions & 7 rubygems

Version Path
piglop-prawn-0.10.2.3 examples/graphics/transparency.rb
piglop-prawn-0.10.2.2 examples/graphics/transparency.rb
piglop-prawn-0.10.2.1 examples/graphics/transparency.rb
prawn-0.11.1.pre examples/graphics/transparency.rb
goodwill-prawn-edge-0.10.0 examples/graphics/transparency.rb
alphasights-prawn-0.10.4 examples/graphics/transparency.rb
alphasights-prawn-0.10.3 examples/graphics/transparency.rb
alphasights-prawn-0.10.2 examples/graphics/transparency.rb
alphasights-prawn-0.10.1 examples/graphics/transparency.rb
alphasights-prawn-0.10.0 examples/graphics/transparency.rb
prawn-core-0.8.4 examples/graphics/transparency.rb
prawn-graph-0.0.2 vendor/prawn-core/examples/graphics/transparency.rb
prawn-graph-0.0.1 vendor/prawn-core/examples/graphics/transparency.rb
prawn-core-0.7.2 examples/graphics/transparency.rb
prawn-core-0.7.1 examples/graphics/transparency.rb
prawn-layout-0.3.2 vendor/prawn-core/examples/graphics/transparency.rb
prawn-core-0.6.3 examples/graphics/transparency.rb
prawn-core-0.6.2 examples/graphics/transparency.rb
prawn-layout-0.3.1 vendor/prawn-core/examples/graphics/transparency.rb
prawn-core-0.6.1 examples/graphics/transparency.rb