ColorTools Package - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : System : Information : Updates : Maple 16 : ColorTools Package

ColorTools Package in Maple 16 

 

The new ColorTools Package 

Color Palettes 

The new ColorTools Package 

The new ColorTools package in Maple 16 allows you to use predefined or custom color palettes, work with different color spaces, and generate or manipulate colors with a variety of tools. 

> with(ColorTools); 1
 

[AddPalette, Adjust, AnalogousSpread, AnsiColorString, Blend, CVDSimulation, Color, ColorDescription, ColorsFromImage, Convert, CoolWarmPair, Darken, Desaturate, DisplayPalette, Distance, EvenSpread, ...
[AddPalette, Adjust, AnalogousSpread, AnsiColorString, Blend, CVDSimulation, Color, ColorDescription, ColorsFromImage, Convert, CoolWarmPair, Darken, Desaturate, DisplayPalette, Distance, EvenSpread, ...
[AddPalette, Adjust, AnalogousSpread, AnsiColorString, Blend, CVDSimulation, Color, ColorDescription, ColorsFromImage, Convert, CoolWarmPair, Darken, Desaturate, DisplayPalette, Distance, EvenSpread, ...
[AddPalette, Adjust, AnalogousSpread, AnsiColorString, Blend, CVDSimulation, Color, ColorDescription, ColorsFromImage, Convert, CoolWarmPair, Darken, Desaturate, DisplayPalette, Distance, EvenSpread, ...
[AddPalette, Adjust, AnalogousSpread, AnsiColorString, Blend, CVDSimulation, Color, ColorDescription, ColorsFromImage, Convert, CoolWarmPair, Darken, Desaturate, DisplayPalette, Distance, EvenSpread, ...
[AddPalette, Adjust, AnalogousSpread, AnsiColorString, Blend, CVDSimulation, Color, ColorDescription, ColorsFromImage, Convert, CoolWarmPair, Darken, Desaturate, DisplayPalette, Distance, EvenSpread, ...
[AddPalette, Adjust, AnalogousSpread, AnsiColorString, Blend, CVDSimulation, Color, ColorDescription, ColorsFromImage, Convert, CoolWarmPair, Darken, Desaturate, DisplayPalette, Distance, EvenSpread, ...
[AddPalette, Adjust, AnalogousSpread, AnsiColorString, Blend, CVDSimulation, Color, ColorDescription, ColorsFromImage, Convert, CoolWarmPair, Darken, Desaturate, DisplayPalette, Distance, EvenSpread, ...
[AddPalette, Adjust, AnalogousSpread, AnsiColorString, Blend, CVDSimulation, Color, ColorDescription, ColorsFromImage, Convert, CoolWarmPair, Darken, Desaturate, DisplayPalette, Distance, EvenSpread, ...
(1.1)
 

 

 

Color Palettes 

You can use predefined color palettes or create your own. 

> ColorTools:-GetPalette(
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
(2.1)
 

> ColorTools:-GetPalette(
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
(2.2)
 

 

The colors can be viewed as swatches. 

> ColorTools:-Swatches(ColorTools:-GetPalette(
 

Plot_2d
 

 

Commands such as ColorTools:-AnalogousSpread or ColorTools:-EvenSpread make creating new palettes easy. 

 

> P := ColorTools:-Palette(ColorTools:-AnalogousSpread(
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi(
(2.3)
 

> ColorTools:-Swatches(P, rows = 4); 1
 

Plot_2d
 

 

Palettes created with the ColorTools package can be used with 2-d plots. 

 

> plots:-setcolors(P); -1
 

> plot([seq(sin(`+`(x, `*`(`/`(1, 20), `*`(i, `*`(Pi))))), i = 1 .. 20)], x = 0 .. `+`(`*`(2, `*`(Pi))), axes = boxed); 1
 

Plot_2d
 

> plots:-setcolors(
 

 

Color Spaces 

The ColorTools package allows you to work with different color spaces, such as the default RGB (Red Green Blue) space, the CMY (Cyan Magenta Yellow) space or the HSV (Hue Saturation Value) space. A full list is given in the ColorTools/ColorSpaces help page. 

> ColorTools:-Color([.4, .3, .8]); 1
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (2.1.1)
 

> ColorTools:-Color(
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (2.1.2)
 

> ColorTools:-Color(
 

Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mi( (2.1.3)
 

 

You can also view colors on the HSV color wheel or a grid of RGB colors with one color channel fixed at a specified value. 

> ColorTools:-HSVColorWheel([
 

Plot_2d
 

> ColorTools:-RGBGrid(red = .3); 1
 

Plot_2d
 

 

Tools for Manipulating Colors 

The ColorTools package contains a large number of tools for generating and manipulating colors. Examples of a few are shown below. 

> ColorTools:-Color(
 

Typesetting:-mprintslash([Typesetting:-mrow(Typesetting:-mo( (2.2.1)
 

> ColorTools:-Color(
 

Typesetting:-mprintslash([Typesetting:-mrow(Typesetting:-mo( (2.2.2)
 

> ColorTools:-Gradient(
 

Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mo(
Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mo(
Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mo(
Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mo(
(2.2.3)
 

> ColorTools:-NeutralSpread(
 

Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mo(
Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mo(
Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mo(
(2.2.4)
 

 

 

See Also 

ColorTools 

plots:-setcolors