Skip to content

Instantly share code, notes, and snippets.

@trajano
Last active May 14, 2020 18:28
Show Gist options
  • Save trajano/062d95826d153cdd3911917a58a6ef31 to your computer and use it in GitHub Desktop.
Save trajano/062d95826d153cdd3911917a58a6ef31 to your computer and use it in GitHub Desktop.
ANSI color dump in perl
for ($i = 0; $i < 30; $i++) {
for ($j = 0; $j < 10; $j++) {
$n = 10*$i + $j;
last if ($n > 255);
print sprintf("\033[%dm %3d\033[m", $n, $n);
}
print "\n";
last if ($n > 255);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment