in reply to Re^4: using colors with print()
in thread using colors with print()
Given the caveat that this is not portable, you specified 'Linux' and 'Terminal', and that you wanted non-modular, try this:
I don't have the kind of patience that tachyon has, so I won't simulate the output, but imagine a labelled grid of foreground/background combinations that looks pretty.#! /usr/bin/perl -w use strict; print ' ', map (" $_ ", 40..47), "\n"; for my $fg (30..37, map {"1;$_"} 30..37) { printf "%9s%s\n", $fg, join ('', map {"\e[${fg}m\e[${_}m Text \e[0m"} 40..47); }
|
|---|