Created
May 28, 2019 18:04
-
-
Save gswallow/95dd5931a76d787f342b2f54f96d78b3 to your computer and use it in GitHub Desktop.
kids.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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