ColorTools - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Graphics : Packages : ColorTools : ColorTools/AddPalette

ColorTools

 AddPalette
 register a color palette

 Calling Sequence AddPalette(N, P)

Parameters

 N - string to be used to identify the palette P - Palette object created with ColorTools[Palette]

Description

 • The AddPalette command registers the palette P with the name N so that it will be usable by all ColorTools commands.  The string N must contain only alphanumeric characters.  It will be stored in lowercase but the capitalization will be preserved.
 • It returns a list of the normalized names of all the known palettes after the addition.

Examples

 > $\mathrm{with}\left(\mathrm{ColorTools}\right):$
 > $P≔\mathrm{Palette}\left(\left["Red"=\mathrm{Color}\left("#f00"\right),"Blue"=\mathrm{Color}\left("#00f"\right),"Green"=\mathrm{Color}\left("#0f0"\right)\right]\right)$
 ${P}{:=}⟨{Palette:}{}\colorbox[rgb]{1,0,0}{{Red}}{}\colorbox[rgb]{0,0,1}{{Blue}}{}\colorbox[rgb]{0,1,0}{Green}⟩$ (1)
 > $\mathrm{AddPalette}\left("Primary",P\right)$
 $\left[{"niagara"}{,}{"nautical"}{,}{"spring"}{,}{"oldplots"}{,}{"mono"}{,}{"dalton"}{,}{"executive"}{,}{"bright"}{,}{"css"}{,}{"html"}{,}{"maplev"}{,}{"x11"}{,}{"resene"}{,}{"generic"}{,}{"primary"}\right]$ (2)
 > $\mathrm{NameToRGB24}\left("Primary Green"\right)$
 $\left[{0}{,}{255}{,}{0}\right]$ (3)
 > $\mathrm{NearestNamedColor}\left(\left[0,255,0\right],\mathrm{palette}="Primary"\right)$
 $\left[{"Primary Green"}{,}{0.}\right]$ (4)
 > $\mathrm{RemovePalette}\left("Primary"\right)$
 $\left[{"niagara"}{,}{"nautical"}{,}{"spring"}{,}{"oldplots"}{,}{"mono"}{,}{"dalton"}{,}{"executive"}{,}{"bright"}{,}{"css"}{,}{"html"}{,}{"maplev"}{,}{"x11"}{,}{"resene"}{,}{"generic"}\right]$ (5)

Compatibility

 • The ColorTools[AddPalette] command was introduced in Maple 16.
 • For more information on Maple 16 changes, see Updates in Maple 16.

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam