termcol: separate gameboy table rows in cpcboy
[sheet.git] / termcol.plp
index 26a5c70e4343d71a343484ee7a91f3a1e6c30624..a090fc7ffe7a36ee3583b570abf1863d92cf338d 100644 (file)
@@ -127,16 +127,13 @@ sub coltable {
                $caption,
        ) if $info->{href} or $info->{title};
 
-       if (my $mapinfo = $info->{rgbmap}) {
+       if ($info->{table} or $info->{rgbmap}) {
                say '<table class="color mapped">';
                say sprintf '<caption>%s</caption>', $caption;
-               print coltable_hsv(@{$mapinfo});
-               say "</table>\n";
-       }
 
-       if (my $table = $info->{table}) {
-               say '<table class="color mapped">';
-               say sprintf '<caption>%s</caption>', $caption;
+               print coltable_hsv(@{$_}) for $info->{rgbmap} || ();
+
+               if (my $table = $info->{table}) {
                for my $row (@$table) {
                        if (!$row) {
                                say '<tbody>';
@@ -155,6 +152,8 @@ sub coltable {
                        print "<tr><td colspan=$width>", img_egapal(\@imgpal, @{$_});
                }
        }
+               }
+
                say "</table>\n";
        }