Sha256: afa9bdb58f12189db3596330963b09e9638e2a02b7f61ed0334642f5eb8341ac

Contents?: true

Size: 815 Bytes

Versions: 4

Compression:

Stored size: 815 Bytes

Contents

#! /usr/local/bin/ruby -w
require 'rvg/rvg'
include Magick

FONT_STYLES = {:font_size=>20, :font_weight=>'bold', :fill=>'white'}

rvg = RVG.new(450, 150) do |canvas|
    canvas.background_fill = 'white'
    canvas.rect(400, 50, 25, 50)
    canvas.circle(40, 100, 75).styles(:opacity=>0.25, :stroke=>'blue', :fill=>'#00ff00',:stroke_width=>8)
    canvas.text(83, 83, '0.25').styles(FONT_STYLES)
    canvas.circle(40, 225, 75).styles(:opacity=>0.50, :stroke=>'blue', :fill=>'#00ff00',:stroke_width=>8)
    canvas.text(208, 83, '0.50').styles(FONT_STYLES)
    canvas.circle(40, 350, 75).styles(:opacity=>0.75, :stroke=>'blue', :fill=>'#00ff00',:stroke_width=>8)
    canvas.text(333, 83, '0.75').styles(FONT_STYLES)
    canvas.rect(449,149).styles(:fill=>'none',:stroke=>'blue')
end

rvg.draw.write('rvg_opacity.gif')

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rmagick-1.8.0 doc/ex/rvg_opacity.rb
rmagick-1.8.1 doc/ex/rvg_opacity.rb
rmagick-1.8.2 doc/ex/rvg_opacity.rb
rmagick-1.8.3 doc/ex/rvg_opacity.rb