Sha256: 658243d73b9cd22ca73f95f98f47f654819a40b41421eb4b08597e9b17bb258d

Contents?: true

Size: 726 Bytes

Versions: 6

Compression:

Stored size: 726 Bytes

Contents

#!/usr/bin/env ruby -w
require 'rmagick'

# Demonstrate the Image#color_floodfill method

before = Magick::Image.new(200, 200) { self.background_color = 'white' }
before.border!(1, 1, 'black')

circle = Magick::Draw.new
circle.fill('transparent')
circle.stroke_width(2)
circle.stroke('black')
circle.circle(100, 100, 180, 100)
circle.fill('plum1')
circle.stroke('transparent')
circle.circle(60, 100, 40, 100)
circle.circle(140, 100, 120, 100)
circle.circle(100, 60, 100, 40)
circle.circle(100, 140, 100, 120)
circle.draw(before)

before.write('color_floodfill_before.gif')

aquamarine = Magick::Pixel.from_color('aquamarine')
after = before.color_floodfill(100, 100, aquamarine)

after.write('color_floodfill_after.gif')
exit

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rmagick-4.1.0.rc2 doc/ex/color_floodfill.rb
rmagick-4.1.0.rc1 doc/ex/color_floodfill.rb
rmagick-4.0.0 doc/ex/color_floodfill.rb
rmagick-3.2.0 doc/ex/color_floodfill.rb
rmagick-3.1.0 doc/ex/color_floodfill.rb
rmagick-3.0.0 doc/ex/color_floodfill.rb