termcol: ppu (nes) palette using 2C04 rgb values
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 21 Dec 2015 00:29:02 +0000 (01:29 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 5 Jan 2016 00:05:07 +0000 (01:05 +0100)
Reference: <http://wiki.nesdev.com/w/index.php/PPU_palettes>

termcol.inc.pl
termcol.plp

index c1966f00bd59927adc614eb1b9d67744c6169e76..f0eb84d9549021da6caaa26512047d6b91bdd80a 100644 (file)
@@ -249,6 +249,34 @@ use Shiar_Sheet::Colour '1.02';
                ],
                parent => 'cpc',
        },
+       ppu => {
+               name => '<abbr title="Picture Processing Unit">PPU</abbr> (Famicom/NES)',
+               table => [
+                       do {
+                               my @rgb = qw(
+                                       333 555 777 777
+                                       014 036 357 567
+                                       006 027 447 657
+                                       326 407 637 757
+                                       403 507 707 747
+                                       503 704 737 755
+                                       510 700 740 764
+                                       420 630 750 770
+                                       320 430 660 773
+                                       120 140 360 572
+                                       031 040 070 473
+                                       000 053 000 276
+                                       022 044 077 467
+                                       111 222 444 666
+                               );
+                               map { [
+                                       map { [ $_, map { $_ * 255 / 7 } split // ] }
+                                       map { $rgb[$_] }
+                                       $_*4 .. $_*4+3
+                               ] } 0..13
+                       }
+               ],
+       },
        ansi88 => {
                name => 'rxvt 88 colour extension',
                rgbmap => [
index b79f8410d931900b0765bcc2cb8233e2d6a7f3c8..3289deb621b36c2563c497a78c0ebd6f841efb06 100644 (file)
@@ -127,6 +127,16 @@ for my $term (@termlist) {
                print "</table>\n\n";
        }
 
+       if (my $table = $info->{table}) {
+               print '<table class="color mapped">'."\n";
+               printf "<caption>%s</caption>\n", $caption;
+               for my $row (@$table) {
+                       print '<tr>';
+                       print colcell(@$_) for @$row;
+               }
+               print "</table>\n\n";
+       }
+
        if (my $palette = $info->{list}) {
                my $order = $get{order} && $get{order}.'order';
                my $colours = colorder($palette,