termcol: amstrad cpc palette (27-colour hsv)
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 1 Nov 2015 03:06:34 +0000 (04:06 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 5 Jan 2016 00:05:07 +0000 (01:05 +0100)
termcol.plp

index 04b6e6e64533f5cad2adedee7531950fd0fff397..4f97abae5cbdb0bc44bc0807c62e6ba5d9818b08 100644 (file)
@@ -221,6 +221,16 @@ for my $term (@termlist) {
        }
        print "</table>\n\n";
 }
+
+if (exists $get{v}) {
+       print "<table class=mapped>\n";
+       print "<caption>Amstrad CPC</caption>\n";
+       print coltable_hsv(3, sub {
+               $_[2] + 3 * ($_[0] + 3 * $_[1]),
+               map { $_ && $_ * 127 + 1 } @_
+       });
+       print "</table>\n\n";
+}
 :></div>
 
 <hr>
@@ -238,7 +248,7 @@ sub coltable_hsv {
 
        my %greymap;  # name => value
        my @colmap;  # saturation => value => hue => [name, r,g,b]
-       my $offset = 16;
+       my $offset = 16 * ($dim > 3);
 
        for my $r (0 .. $dim - 1) {
                for my $g (0 .. $dim - 1) {