Skip to content

Instantly share code, notes, and snippets.

@JoshCheek
Created February 4, 2016 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshCheek/7c4fa63e81c5d73ec444 to your computer and use it in GitHub Desktop.
Save JoshCheek/7c4fa63e81c5d73ec444 to your computer and use it in GitHub Desktop.
Students made this! <3
# if this fails, you can get it with `gem install chunky_png`
require 'chunky_png'
bg_color = ChunkyPNG::Color.rgb 100, 50, 0
line_color = ChunkyPNG::Color.rgb 150, 150, 200
canvas = ChunkyPNG::Canvas.new 1200, 900, bg_color
i = 0
while i < 100
canvas.circle 600 , 450, 100 , line_color
canvas.line 500+i, 350+i, 500, 350, line_color
canvas.line 400+i, 450+i, 400, 450, line_color
i += 1
end
canvas.save("pic.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment