Created
August 4, 2017 00:31
-
-
Save levicole/97b75ce32fdd63b7d75ed80921098b56 to your computer and use it in GitHub Desktop.
Random Color Printer
This file contains 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
text = ARGV | |
colorized = text.map do |word| | |
r = rand(256) | |
g = rand(256) | |
b = rand(256) | |
"\x1b[38;2;#{r};#{g};#{b}m#{word}\x1b[0m" | |
end.join(" ") | |
STDOUT.print "#{colorized}\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment