-my $pumpkin = ["255/185/15", "0 0 0"];
-my $green = ["0/238/118", "1 1 1"];
-my $red = ["1 0 0", "0 0 0"];
-my $blue = ["0 .4 1 ", "1 1 1"];
-my $yellow = ["1 1 0", "0 0 0"];
-my $moth = [" 0 0 0", "1 1 1"];
-my $purple = ["145/44/238", "0 0 0"];
-my $lotus = [("0/245/255",) x 2];
-my $white = ["1 1 1", "0 0 0"];
-
-my $anychip = ['0.8', '0'];
-
-our $page_pre = <<END;
-72 25.4 div dup scale
-%210 0 translate
-%90 rotate
-7 10 translate
-END
-
-sub colour ($) {
- my ($c) = @_;
- if ($c =~ m{^(\d+)/(\d+)/(\d+)$}) {
- return (join ' ', map { $_ / 255.0 } ($1,$2,$3)).' setrgbcolor';
- } elsif ($c =~ m/[^ 0-9.]/) {
- return $c;
- } elsif ($c =~ m/^\s*\S+\s*$/) {
- return "$c setgray";
- } elsif ($c =~ m/./) {
- return "$c setrgbcolor";
- } else {
- return '';
- }
-}
-
-our $black = colour('0');
-
-sub chip ($$) {
- my ($cary, $pips) = @_; # put in a gsave translate
- my $o = <<END;
- newpath
- 0 0 chip 0.5 mul 0 360 arc
- gsave 1 setlinewidth $black stroke grestore
- ${\ colour($cary->[0]) } fill
-END
- if ($pips) {
- $o .= <<END;
- ${\ colour($cary->[1]) }
-END
- }
- my $spot = sub {
- my ($x,$y) = @_;
- $o .= <<END;
- newpath
- spot 0.5 sqrt mul 1.1 mul dup
- $x mul exch $y mul
- spot 0.5 mul
- 0 360 arc fill
-END
- };
-
- $spot->( 0, 0) if $pips & 1;
- $spot->(-1,-1) if $pips & 6;
- $spot->(+1,+1) if $pips & 6;
- $spot->(-1,+1) if $pips & 4;
- $spot->(+1,-1) if $pips & 4;
-
- $o;
-}