Last active
July 9, 2016 12:18
-
-
Save evaldasg/3cc9cef79a410660df2702cbe9e50efd to your computer and use it in GitHub Desktop.
Print out to the console terminal's 256 width colors.
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 | |
# This prints to the console 256 colors for foreground & background | |
%w(38 48).each do |fgbg| # Foreground/Background | |
(0..256).each do |color| | |
print "\e[#{fgbg};5;#{color}m" + " #{color}".ljust(8, ' ') + "\e[0m" | |
print "\n" if (color + 1) % 10 == 0 | |
end | |
print "\n\n" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment