Skip to content

Commit

Permalink
Merge pull request rmagick-temp#123 from prijutme4ty/solid_fill
Browse files Browse the repository at this point in the history
New class SolidFill in order to fill image with monochromatic background
  • Loading branch information
ioquatix committed Sep 15, 2014
2 parents e919070 + 7a84e91 commit 7e649a8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/RMagick.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1958,5 +1958,17 @@ def fill(img) # required
end
end

# Fill class with solid monochromatic color
class SolidFill
def initialize(bgcolor)
@bgcolor = bgcolor
end

def fill(img)
img.background_color = @bgcolor
img.erase!
end
end

end # Magick

0 comments on commit 7e649a8

Please sign in to comment.