termcol: page to list unix terminal colours
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 9 May 2009 01:24:15 +0000 (01:24 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 13 Oct 2009 22:38:42 +0000 (22:38 +0000)
termcol.plp [new file with mode: 0644]

diff --git a/termcol.plp b/termcol.plp
new file mode 100644 (file)
index 0000000..3dd1d1b
--- /dev/null
@@ -0,0 +1,61 @@
+<:
+use utf8;
+use strict;
+use warnings;
+use open IO => ':utf8';
+
+our $VERSION = 'v1.0';
+
+$header{content_type} = 'text/html; charset=utf-8';
+
+:><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<head>
+<title>terminal colour cheat sheet</title>
+<meta http-equiv="content-type" content="utf-8">
+<link rel="stylesheet" type="text/css" media="all" href="/base.css">
+</head>
+
+<body>
+<h1>Terminal colours</h1>
+
+<table>
+<tr><th>#<td>xterm</tr>
+<:
+my %col = (
+       -name => [
+               qw/black red green orange blue magenta cyan gray
+                  gray red green yellow blue magenta cyan white/,
+               qw/reset bold dim italic underline blink fastblink
+                  reverse hidden/,
+       ],
+       linux => [
+               qw/000 CCC/,
+               qw/000 A00 0A0 A50 00A A0A 0AA AAA
+                  555 F55 5F5 FF5 55F F5F 5FF FFF/,
+       ],
+       xterm => [
+               qw/000 CCC/,
+               qw/000 C00 0C0 CC0 4682B4 C0C 0CC E5E5E5
+                  4C4C4C F00 0F0 FF0 1E90FF F0F 0FF FFF/,
+       ],
+       tango => [
+               qw/000 CCC/,
+               qw/2E3436 CC0000 4E9A06 C4A000 3465A4 75507B 06989A D3D7CF
+                  555753 EF2929 8AE234 FCE94F 729FCF AD7FA8 34E2E2 EEEEEC/,
+       ],
+);
+
+for my $num (0 .. 15) {
+       printf('<tr><th>%d<td>%s%s</tr>'."\n",
+               $num,
+               $col{-name}[$num],
+               join('', map {sprintf '<td style="%s">&nbsp;▪&nbsp;',
+                       'background:#'.$col{$_}[0].'; color:#'.$col{$_}[$num + 2],
+               } qw/linux xterm tango/ ),
+       );
+}
+:></table>
+