 CVD - Maple Help

CVD Color Palette Description

 • The CVD plot palette is a selection of colors to be more easily distinguishable for viewers with all types of color defective vision (color blindness). It is designed for coloring filled areas. There are twelve colors in the palette, all of which should be distinguishable by viewers with deuteranopia and protanopia. The first nine should be distinguishable by viewers with tritanopia.
 > ColorTools:-DisplayPalette("CVD",noextend);

 1. Green Blue 2. Yellow 3. Pale Purple 4. Green 5. Blue 6. Red 7. Pale Orange 8. Light Blue 9. Orange 10. Pale Green 11. Purple 12. Light Green Blue

 • Two variations of this palette are provided and named CVD2 and CVD3 that are optimized for protanopia and tritanopia respectively. They have the same initial colors, but will produce different colors when automatically extended. 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["CVD 2","CVD Blue"\right]\right)$ > $C≔\mathrm{ColorTools}:-\mathrm{Color}\left("CVD 5"\right)$
 ${\mathrm{ColorTools}}{:-}{\mathrm{Color}}{}\left({"RGB"}{,}\left[{0.}{,}{0.35294118}{,}{0.78431373}\right]\right)$ (1)

You can make CVD the default palette in plots using setcolors

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

You can programmatically access the colors using ColorTools commands

 > $P≔\mathrm{ColorTools}:-\mathrm{GetPalette}\left("CVD"\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}}{,}{\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[{"Green Blue"}{,}{"Yellow"}{,}{"Pale Purple"}{,}{"Green"}{,}{"Blue"}{,}{"Red"}{,}{"Pale Orange"}{,}{"Light Blue"}{,}{"Orange"}{,}{"Pale Green"}{,}{"Purple"}{,}{"Light Green Blue"}\right]{,}\left[{}\right]{,}{\mathrm{palettename}}{=}{"CVD"}{,}{\mathrm{palettetype}}{=}{"fill"}\right)$ (2)
 > $P\left[1\right]$
 ${\mathrm{ColorTools}}{:-}{\mathrm{Color}}{}\left({"RGB"}{,}\left[{0.}{,}{0.4313725490}{,}{0.5098039215}\right]{,}{\mathrm{caption}}{=}{"Green Blue"}\right)$ (3)
 > $n≔\mathrm{numcolors}\left(P\right)$
 ${n}{≔}{12}$ (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{line}\right)$ ColorTools algorithms will automatically generate new colors beyond the main 12 colors.  Extended colors are algorithmically generated and will attempt to be well distributed for red-green color blind viewers.

 > $P\left[16\right]$
 ${\mathrm{ColorTools}}{:-}{\mathrm{Color}}{}\left({"RGB"}{,}\left[{-}{2.801471657}{}{{10}}^{{-9}}{,}{0.01540616326}{,}{0.5098039214}\right]\right)$ (5)

The CVD 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.}{,}{0.41502782}{,}{0.49098682}\right]\right)$ (6)
 > $\mathrm{Lookup}\left(P,1,\mathrm{shade}="point"\right)$
 ${\mathrm{ColorTools}}{:-}{\mathrm{Color}}{}\left({"RGB"}{,}\left[{0.}{,}{0.39286271}{,}{0.46550218}\right]\right)$ (7)
 > References