Patchwork - Maple Help

Patchwork Color Palette

Description

 • The Patchwork plot palette is a collection of bright colors, originally designed to yield attractive maps. See for example the WorldMap object. It is designed for coloring collections of filled areas. There are ten colors in the palette.
 > ColorTools:-DisplayPalette("Patchwork",noextend);

 1. Blue 2. RedOrange 3. BluePurple 4. Red 5. DarkBlue 6. Yellow 7. DarkGreen 8. DarkRed 9. Green 10. PaleBlue

Examples

You can reference colors in the palette by name or number in most commands that understand color names.

 > $\mathrm{plot}\left(\left[x,{x}^{3}\right],x=-1..1,\mathrm{color}=\left["Patchwork 2","Patchwork Blue"\right]\right)$
 > $C≔\mathrm{ColorTools}:-\mathrm{Color}\left("Patchwork 10"\right)$
 ${\mathrm{ColorTools}}{:-}{\mathrm{Color}}{}\left({"RGB"}{,}\left[{0.41960784}{,}{0.72549020}{,}{0.94117647}\right]\right)$ (1)

You can make Patchwork the default palette in plots using setcolors

 > $\mathrm{plots}:-\mathrm{setcolors}\left("Patchwork"\right):$

You can programatically access the colors using ColorTools commands

 > $P≔\mathrm{ColorTools}:-\mathrm{GetPalette}\left("Patchwork"\right)$
 ${\mathrm{ColorTools}}{:-}{\mathrm{Palette}}{}\left(\left[{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}{,}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}\right]{,}\left[{"Blue"}{,}{"RedOrange"}{,}{"BluePurple"}{,}{"Red"}{,}{"DarkBlue"}{,}{"Yellow"}{,}{"DarkGreen"}{,}{"DarkRed"}{,}{"Green"}{,}{"PaleBlue"}\right]{,}\left[{}\right]{,}{\mathrm{palettename}}{=}{"Patchwork"}{,}{\mathrm{palettetype}}{=}{"fill"}\right)$ (2)
 > $P\left[1\right]$
 ${\mathrm{ColorTools}}{:-}{\mathrm{Color}}{}\left({"RGB"}{,}\left[{0.26666667}{,}{0.42352941}{,}{0.70196078}\right]{,}{\mathrm{caption}}{=}{"Blue"}\right)$ (3)
 > $n≔\mathrm{numcolors}\left(P\right)$
 ${n}{≔}{10}$ (4)
 > $\mathrm{plot}\left(\left[\mathrm{seq}\left(\mathrm{sin}\left(x+\frac{i\mathrm{\pi }}{n}\right),i=1..n\right)\right],x=0..2\mathrm{\pi },\mathrm{axes}=\mathrm{boxed},\mathrm{color}=:-\mathrm{GetColors}\left(P\right)\left[1..n\right],\mathrm{legend}=:-\mathrm{GetColorNames}\left(P\right)\left[1..n\right],\mathrm{numpoints}=25,\mathrm{style}=\mathrm{point}\right)$

ColorTools algorithms will automatically generate new colors beyond the main 10 colors:

 > $P\left[20\right]$
 ${\mathrm{ColorTools}}{:-}{\mathrm{Color}}{}\left({"RGB"}{,}\left[{0.4135121374}{,}{0.5098039199}{,}{0.1176470599}\right]\right)$ (5)

The Patchwork palette is designed for filled areas, but the Lookup command can provide slightly altered shades of its colors for use in coloring points or lines.

 > $\mathrm{Lookup}\left(P,1,\mathrm{shade}="line"\right)$
 ${\mathrm{ColorTools}}{:-}{\mathrm{Color}}{}\left({"RGB"}{,}\left[{0.070353607}{,}{0.35787069}{,}{0.67240164}\right]\right)$ (6)
 > $\mathrm{Lookup}\left(P,1,\mathrm{shade}="point"\right)$
 ${\mathrm{ColorTools}}{:-}{\mathrm{Color}}{}\left({"RGB"}{,}\left[{0.058982486}{,}{0.34293945}{,}{0.64756084}\right]\right)$ (7)
 >