Skip to content

Instantly share code, notes, and snippets.

@treed
Created February 2, 2010 22:27
use Digest::MD5 qw(md5_hex);
my $text = $ARGV[0];
my @colors = (21,23..51,63..87,99..231,246..253);
my $colors = @colors;
my $color = $colors[int(md5_hex($text)) % $colors];
print "[38;5;" . $color . "m$text\n" . "";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment