Skip to content

Instantly share code, notes, and snippets.

@gswallow
Created May 28, 2019 18:04
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 gswallow/95dd5931a76d787f342b2f54f96d78b3 to your computer and use it in GitHub Desktop.
Save gswallow/95dd5931a76d787f342b2f54f96d78b3 to your computer and use it in GitHub Desktop.
kids.rb
#!/usr/bin/env ruby
require 'magic_cloud'
name = ARGV[0]
major = ARGV[1]
minor = ARGV[2]
angles = [350, 260, 80]
words = Array.new
words << [name, 90]
major.split(' ').each do |word|
words << [word.gsub('_', ' ').gsub('\\', ''), 50]
end
minor.split(' ').each do |word|
words << [word.gsub('_', ' ').gsub('\\', ''), 25]
end
cloud = MagicCloud::Cloud.new(words, pallette: :category20c, rotate: angles, scale: :no)
img = cloud.draw(1200, 400)
img.write("#{name}.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment