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

Online Help

All Products    Maple    MapleSim


ColorTools

  

Blend

  

generate a blend of colors

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Blend(color1..color2, value, options)

Blend(colorlist, value, options)

Parameters

color1,color2

-

colors in formats recognized by ColorTools

colorlist

-

list or Array of colors in formats recognized by ColorTools or a palette name or Palette object

value

-

(optional) value between 0 and 1; sample point

options

-

(optional) equation(s) of the form option=value where option is one of space, markers, or displayable

Options

• 

displayable=truefalse := false

  

If this keyword is given then each output color will be displayable, and when represented in the "RGB" color space all three component values of each output color will be between 0 and 1. The default value for this option is false.

• 

markers=list or Array

• 

The parameter thresholds corresponding to each of the specified input colors.

• 

space=string

• 

The color space in which to compute the intermediate colors; if unspecified, this is inferred from the colors spaces of the input when possible, defaulting to "RGB" otherwise.

Description

• 

The Blend command generates a blend of the specified colors.

• 

The first parameter specifies the colors to blend. This may be a range color1..color2 or a list or palette of colors.

• 

The second parameter value specifies a point at which to interpolate.

• 

For example, Blend(red..blue,3/4) will produce a blend of 3/4 blue and 1/4 red.

Examples

withColorTools:

Interpolate linearly between white and blue in the default color space.

Blendwhite..blue,23

RGB : 0.333 0.333 1

(1)

Interpolate linearly between white and blue in the HSV color space.

Blendwhite..blue,23,space=HSV

HSV : 0.444 0.667 1

(2)

Interpolate linearly between three colors: red, white, and green.

Blendred,white,green,0.25

RGB : 1 0.5 0.5

(3)

Interpolate linearly with specified thresholds, marking all values <= 0.1 as red and all values >= 0.8 as green.

fBlendred&comma;yellow&comma;green&comma;markers=0.1&comma;0.45&comma;0.8&colon;

seqfi&comma;i=0..1&comma;0.2

RGB : 1 0 0,RGB : 1 0.286 0,RGB : 1 0.857 0,RGB : 0.571 1 0,RGB : 0 1 0,RGB : 0 1 0

(4)

The color halfway in the "Lab" color space between red and green is not displayable. Note that after conversion to the "RGB" color space the blue component is negative and so not between 0 and 1. This is the default behavior of the Blend command.

cBlendred..green&comma;12&comma;space=Lab&comma;displayable=false

c*Lab* : 70.5 -3.03 75.2

(5)

ColorRGB&comma;c

*RGB* : 0.786 0.671 -0.0653

(6)

The displayable option forces the result above to be a color that is displayable in the "RGB" color space. Note that the blue component is now between 0 and 1.

cBlendred..green&comma;12&comma;space=Lab&comma;displayable=true

cLab : 70.5 -2.95 73.1

(7)

ColorRGB&comma;c

RGB : 0.786 0.671 0

(8)

Compatibility

• 

The ColorTools[Blend] command was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

• 

The ColorTools[Blend] command was updated in Maple 2022.

• 

The colorlist parameter was updated in Maple 2022.

See Also

ColorTools

ColorTools/ColorSpaces

ColorTools[Color]

ColorTools[Gradient]

ColorTools[ToDisplayable]