termcol: include and mark duplicate colours in ppu
[sheet.git] / termcol.inc.pl
index 0aa22410d34425e32ba635a42e6427be3f12a39f..32427759de296675b374ed873e12c62ac6db441d 100644 (file)
@@ -7,6 +7,12 @@ use Shiar_Sheet::Colour 1.05;
        ansi    => [qw( cga putty xterm tango app html cgarne )],
        legacy  => [qw( c64 msx mac2 risc arnegame dawnbringer cpc cpcboy shiar32 ppu 64 )],
 
+       xcolors => sub {
+               my $pals = do 'termcol-xcolor.inc.pl' or die $! || $@;
+               $_[0]->{$_} = $pals->{$_} for keys %{$pals};
+               return 'xcolor';
+       },
+
        html => {
                title => 'HTML keywords (inherited by CSSā‰„2.1 and SVG), mostly identical to X11',
                href => 'http://www.w3.org/TR/css3-color/#html4',
@@ -282,6 +288,7 @@ use Shiar_Sheet::Colour 1.05;
                        [qw(         0 6C71C4:3J         0 )],
                        [qw( 362747:1K 75507B:3K F06FCB:5K )],
                        [qw(         0 D33662:3L         0 )],
+                       undef,
                        [qw( 000000:0  686868:2  CCCCCC:4  )],
                        [qw( 444444:1  B0B0B0:3  FFFFFF:5  )],
                ],
@@ -303,12 +310,13 @@ use Shiar_Sheet::Colour 1.05;
                                        320 430 660 773
                                        120 140 360 572
                                        031 040 070 473
-                                       000 053 000 276
+                                       040 053 276 276
                                        022 044 077 467
                                        111 222 444 666
                                );
+                               my %dup;
                                map { [
-                                       map { [ $_, map { $_ * 255 / 7 } split // ] }
+                                       map { [ $dup{$_}++ ? "<s>$_</s>" : $_, map { $_ * 255 / 7 } split // ] }
                                        map { $rgb[$_] }
                                        $_*4 .. $_*4+3
                                ] } 0..13