ColorTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Graphics : Packages : ColorTools : Color and Color Object Manipulation Commands : ColorTools/ToDisplayable

ColorTools

  

ToDisplayable

  

compute a nearby color that can be represented in RGB

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

ToDisplayable(color, mopt)

Parameters

color

-

color in a format recognized by ColorTools

mopt

-

(optional) equation of the form mode = string, indicating the method used to compute the resulting color

Description

• 

Many colors in the device independent colors spaces, such as CIE Lab, cannot be exactly represented in RGB and displayed on a monitor.  The ToDisplayable command computes a nearby color that can be represented in RGB and thus displayed.

• 

A color object that is not exactly displayable will be displayed with asterisks around the color space when the color object is printed.

• 

By default a nearby color is determined by moving along the line towards the 50% gray in the CIE XYZ color space until a displayable color is reached. This can be specified explicitly by specifying the option mode = "XYZ".

• 

Specifying mode = "Lab" will instead move along the line towards the neutral gray point in the CIE Lab color space that has the same L-coordinate as color.

• 

Specifying mode = "HSV" will preserve the hue and truncate the saturation and value coordinates of color in the HSV color space to the range 0..1.

• 

Specifying mode = "RGB" will truncate each of the coordinates of color in the RGB color space to the range 0..1.

• 

Specifying mode = "RGBscale" will represent color in the RGB color space, then add the same minimal positive constant to each coordinate that makes all entries non-negative, and finally, if necessary, divide each coordinate by the maximal coordinate, so that the coordinates are all in the range 0..1.

Examples

withColorTools:

CColor0.293,0.128,0.132

C*RGB* : 0.293 -0.128 0.132

(1)

C1ToDisplayableC

C1RGB : 0.31 0 0.172

(2)

C2ToDisplayableC,mode=Lab

C2RGB : 0.214 0 0.115

(3)

C3ToDisplayableC,mode=HSV

C3RGB : 0.293 0 0.181

(4)

C4ToDisplayableC,mode=RGB

C4RGB : 0.293 0 0.132

(5)

C5ToDisplayableC,mode=RGBscale

C5RGB : 0.421 0 0.26

(6)

SwatchesC1,C2,C3,C4,C5,rows=1

Compatibility

• 

The ColorTools[ToDisplayable] command was introduced in Maple 18.

• 

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

See Also

ColorTools

ColorTools/ColorSpaces

ColorTools[Color]