From e2353e5d392441ba821a672341cb7218e48d61de Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 21 Dec 2015 01:29:02 +0100 Subject: [PATCH] termcol: ppu (nes) palette using 2C04 rgb values Reference: --- termcol.inc.pl | 28 ++++++++++++++++++++++++++++ termcol.plp | 10 ++++++++++ 2 files changed, 38 insertions(+) diff --git a/termcol.inc.pl b/termcol.inc.pl index c1966f0..f0eb84d 100644 --- a/termcol.inc.pl +++ b/termcol.inc.pl @@ -249,6 +249,34 @@ use Shiar_Sheet::Colour '1.02'; ], parent => 'cpc', }, + ppu => { + name => 'PPU (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 => [ diff --git a/termcol.plp b/termcol.plp index b79f841..3289deb 100644 --- a/termcol.plp +++ b/termcol.plp @@ -127,6 +127,16 @@ for my $term (@termlist) { print "\n\n"; } + if (my $table = $info->{table}) { + print ''."\n"; + printf "\n", $caption; + for my $row (@$table) { + print ''; + print colcell(@$_) for @$row; + } + print "
%s
\n\n"; + } + if (my $palette = $info->{list}) { my $order = $get{order} && $get{order}.'order'; my $colours = colorder($palette, -- 2.30.0