Skip to content

Instantly share code, notes, and snippets.

@d11wtq
Created October 28, 2012 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save d11wtq/3970335 to your computer and use it in GitHub Desktop.
Save d11wtq/3970335 to your computer and use it in GitHub Desktop.
ANSI Color Test Script
class AnsiColorTest
FG = 38
BG = 48
class << self
def label(n, type)
"\033[01;#{type};5;#{n}m %3s \033[0m" % n
end
def dump256
(0..255).each {|n| puts label(n, FG) + " " + label(n, BG) }
end
end
end
AnsiColorTest.dump256
@d11wtq
Copy link
Author

d11wtq commented Oct 28, 2012

Output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment