Skip to content

Instantly share code, notes, and snippets.

@DimaD
Created March 8, 2009 12:53
Show Gist options
  • Save DimaD/75778 to your computer and use it in GitHub Desktop.
Save DimaD/75778 to your computer and use it in GitHub Desktop.
require 'rmagick'
STR = %w(CF EE E7 E4 F0 E0 E2 EB FF FE 20 F1 20 38 20 EC E0 F0 F2 E0 21 20 C6 E5 EB E0 FE 20 E2 F1 E5 E3 EE 2D E2 F1 E5 E3 EE 20 3A 29)
SIDE = 20
canvas = Magick::Image.new(STR.size*SIDE, SIDE, Magick::HatchFill.new('white', 'lightcyan2'))
gc = Magick::Draw.new
STR.each_with_index do |color, i|
gc.fill("##{color}2")
gc.rectangle(i*SIDE, 0, i*SIDE + SIDE, SIDE)
end
gc.draw(canvas)
canvas.write('congratulations.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment