module ChunkyPNG::Canvas::Operations
def border!(size, color = ChunkyPNG::Color::BLACK)
- See: #border -
Returns:
-
(ChunkyPNG::Canvas)- Returns itself with the border added.
Parameters:
-
color(Integer) -- The color of the border. -
size(Integer) -- The size of the border.
def border!(size, color = ChunkyPNG::Color::BLACK) new_width = width + size * 2 new_height = height + size * 2 bg = Canvas.new(new_width, new_height, color).replace(self, size, size) replace_canvas!(new_width, new_height, bg.pixels) end