ColorTools
CoolWarmPair
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
CoolWarmPair( palette )
palette
-
palette name as a string (see ColorCollections), a palette object (see Palette) or a list of colors
shade : a shade modifier passed to the color lookup if palette name or object is given
paletteonly : if given, both colors are chosen from the palette instead of one of them being generated
CoolWarmPair returns a list of two colors that can be used for a "cool" to "warm" gradient (or light to dark in the case of grayscale). One of the colors returned is always the first color from the palette provided, and the other color is a computed contrasting color.
An exception is made for the case of the CVD palettes, in which case the return is always the first two colors of those palettes.
Here are the coolwarm pairs for all the built-in plot palettes.
plotpalettes≔select⁡p↦:−GetPaletteType⁡ColorTools:−GetPalette⁡pinfill,line,ColorTools:-PaletteNames⁡
plotpalettes≔Bright,Dalton,Executive,Mono,Nautical,Niagara,Patchwork,Spring,CVD,CVD2,CVD3
CWpairs≔seq⁡p,ColorTools:-CoolWarmPair⁡p,pinplotpalettes
CWpairs≔Bright,〈RGB : 0.2 0.4 0.8〉,〈RGB : 0.898 0.331 0.313〉,Dalton,〈RGB : 0.337 0.706 0.914〉,〈RGB : 0.796 0.324 0.484〉,Executive,〈RGB : 0.271 0.451 0.655〉,〈RGB : 0.847 0.427 0.464〉,Mono,〈Gs : 0.597〉,〈Gs : 0.18〉,Nautical,〈RGB : 0.2 0.302 0.392〉,〈RGB : 0.613 0.362 0.403〉,Niagara,〈RGB : 0.229 0.403 0.782〉,〈RGB : 0.471 0 0.0549〉,Patchwork,〈RGB : 0.267 0.424 0.702〉,〈RGB : 0.862 0.394 0.38〉,Spring,〈RGB : 0 0.455 0.8〉,〈RGB : 0.93 0.342 0.421〉,CVD,〈RGB : 0 0.353 0.784〉,〈RGB : 0.98 0.471 0.314〉,CVD2,〈RGB : 0 0.431 0.51〉,〈RGB : 0.941 0.941 0.196〉,CVD3,〈RGB : 0 0.431 0.51〉,〈RGB : 0.98 0.471 0.314〉
DocumentTools:-Tabulate⁡Palette Name,Cool,Warm,map⁡r↦r1,\n,\n,CWpairs,`=`⁡fillcolor,M,i,j↦ifelse⁡i=1,LightGrey,ifelse⁡j=1,White,ColorTools:−RGB24ToHex⁡:−ToRGB24⁡CWpairsi−1j:
Palette Name
Cool
Warm
Bright
Dalton
Executive
Mono
Nautical
Niagara
Patchwork
Spring
CVD
CVD2
CVD3
The ColorTools:-CoolWarmPair command was introduced in Maple 2023.
For more information on Maple 2023 changes, see Updates in Maple 2023.
See Also
ColorCollections
Download Help Document