chiark / gitweb /
fixes to cmyk
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 6 Mar 2019 15:02:16 +0000 (15:02 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 6 Mar 2019 15:02:16 +0000 (15:02 +0000)
generate-board

index f7e3cdb9fb589faa8f63c394ac177897ee81c59c..8de6473743d9d75462aeed5948aa68f3dedca415 100755 (executable)
@@ -410,17 +410,18 @@ sub pscolour ($$$$) {
     $rw = 'setrgbcolor';
   } elsif ($spec =~ m/[CMYK]/) {
     my @specs = split /\//, $spec;
-    if ($cmykix==0 && @specs==1) {
+    if ($cmykix==1 && @specs==1) {
       $spec = $specs[0];
     } else {
       $spec = $specs[$cmykix];
-      confess unless defined;
+      confess unless defined $spec;
     }
     my %cmyk;
     foreach (split /(?=[A-Z])/, $spec) {
-      m/^([CMYK])(?:[0-7]\.\d*|8)_?$/ or confess $_.' ?';
+      m/^([CMYK])([0-7]\.\d*|8)_?$/ or confess $_.' ?';
       confess if defined $cmyk{$1};
       $cmyk{$1} = $2 / 8.;
+      print STDERR " CMYK $1 $2\n";
     }
     @r = map { $cmyk{$_} // 0 } qw(C M Y K);
     $rw = 'setcmykcolor';