From b04c2e1a42573e9735547702356c7b9a769a6855 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 7 Apr 2013 18:26:53 +0000 Subject: texmf -> texmf-dist: doc git-svn-id: svn://tug.org/texlive/trunk@29714 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/asymptote/examples/colors.asy | 116 +++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 Master/texmf-dist/doc/asymptote/examples/colors.asy (limited to 'Master/texmf-dist/doc/asymptote/examples/colors.asy') diff --git a/Master/texmf-dist/doc/asymptote/examples/colors.asy b/Master/texmf-dist/doc/asymptote/examples/colors.asy new file mode 100644 index 00000000000..ea576379deb --- /dev/null +++ b/Master/texmf-dist/doc/asymptote/examples/colors.asy @@ -0,0 +1,116 @@ +int i=0; +int j=0; + +bool components=false; + +pen p; + +void col(bool fill=false ... string[] s) { + for(int n=0; n < s.length; ++n) { + j -= 10; + string s=s[n]; + eval("p="+s+";",true); + if(components) { + real[] a=colors(p); + for(int i=0; i < a.length; ++i) + s += " "+(string) a[i]; + } + if(fill) label(s,(i+10,j),E,p,Fill(gray)); + else label(s,(i+10,j),E,p); + fill(box((i,j-5),(i+10,j+5)),p); + } +} + +col("palered"); +col("lightred"); +col("mediumred"); +col("red"); +col("heavyred"); +col("brown"); +col("darkbrown"); +j -= 10; + +col("palegreen"); +col("lightgreen"); +col("mediumgreen"); +col("green"); +col("heavygreen"); +col("deepgreen"); +col("darkgreen"); +j -= 10; + +col("paleblue"); +col("lightblue"); +col("mediumblue"); +col("blue"); +col("heavyblue"); +col("deepblue"); +col("darkblue"); +j -= 10; + +i += 150; +j=0; + +col("palecyan"); +col("lightcyan"); +col("mediumcyan"); +col("cyan"); +col("heavycyan"); +col("deepcyan"); +col("darkcyan"); +j -= 10; + +col("pink"); +col("lightmagenta"); +col("mediummagenta"); +col("magenta"); +col("heavymagenta"); +col("deepmagenta"); +col("darkmagenta"); +j -= 10; + +col("paleyellow"); +col("lightyellow"); +col("mediumyellow"); +col("yellow"); +col("lightolive"); +col("olive"); +col("darkolive"); +j -= 10; + +col("palegray"); +col("lightgray"); +col("mediumgray"); +col("gray"); +col("heavygray"); +col("deepgray"); +col("darkgray"); +j -= 10; + +i += 150; +j=0; + +col("black"); +col("white",fill=true); +j -= 10; + +col("orange"); +col("fuchsia"); +j -= 10; +col("chartreuse"); +col("springgreen"); +j -= 10; +col("purple"); +col("royalblue"); +j -= 10; + +col("Cyan"); +col("Magenta"); +col("Yellow"); +col("Black"); + +j -= 10; + +col("cmyk(red)"); +col("cmyk(blue)"); +col("cmyk(green)"); -- cgit v1.2.3