summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/asymptote/palette.asy
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-03-03 22:41:44 +0000
committerKarl Berry <karl@freefriends.org>2020-03-03 22:41:44 +0000
commit8b67398a304b54846d01ad667cf1fbb6eb0245d2 (patch)
treec5e045c9d36b21c8dffece4499e2a47e5dd4df8e /Master/texmf-dist/asymptote/palette.asy
parentf76a89d7f9fc8837ce20a63e3a29b2ba75823159 (diff)
asymptote 2.63 support files
git-svn-id: svn://tug.org/texlive/trunk@54036 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/asymptote/palette.asy')
-rw-r--r--Master/texmf-dist/asymptote/palette.asy9
1 files changed, 5 insertions, 4 deletions
diff --git a/Master/texmf-dist/asymptote/palette.asy b/Master/texmf-dist/asymptote/palette.asy
index 2cb6e7c5475..e77fa946e6b 100644
--- a/Master/texmf-dist/asymptote/palette.asy
+++ b/Master/texmf-dist/asymptote/palette.asy
@@ -358,10 +358,10 @@ pen[] Wheel(int NColors=32766)
if(settings.gray) return Grayscale(NColors);
int nintervals=6;
+ if(NColors <= nintervals) NColors=nintervals+1;
int n=-quotient(NColors,-nintervals);
pen[] Palette;
- if(n == 0) return Palette;
Palette=new pen[n*nintervals];
real ninv=1.0/n;
@@ -386,10 +386,10 @@ pen[] Rainbow(int NColors=32766)
int offset=1;
int nintervals=5;
+ if(NColors <= nintervals) NColors=nintervals+1;
int n=-quotient(NColors-1,-nintervals);
pen[] Palette;
- if(n == 0) return Palette;
Palette=new pen[n*nintervals+offset];
real ninv=1.0/n;
@@ -418,12 +418,13 @@ private pen[] BWRainbow(int NColors, bool two)
if(two) nintervals += 6;
+ int Nintervals=nintervals*divisor;
+ if(NColors <= Nintervals) NColors=Nintervals+1;
int num=NColors-offset;
- int n=-quotient(num,-nintervals*divisor)*divisor;
+ int n=-quotient(num,-Nintervals)*divisor;
NColors=n*nintervals+offset;
pen[] Palette;
- if(n == 0) return Palette;
Palette=new pen[NColors];
real ninv=1.0/n;