termcol: include and mark duplicate colours in ppu
[sheet.git] / termcol.inc.pl
index bf0001bab25d830c62ea1d8db1c20407e3cbdaf2..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',
@@ -304,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