ColorTools - Maple Programming Help

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

ColorTools

 ToDisplayable
 compute a nearby color that can be represented in RGB

 Calling Sequence ToDisplayable(color)

Parameters

 color - color in a format recognized by ColorTools

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.
 • 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.
 • Simpler algorithms which truncate the color into a 0 to 1 range in RGB or HSV color space can be used instead by specifying the mode option.

Examples

 > $\mathrm{with}\left(\mathrm{ColorTools}\right):$
 > $C≔\mathrm{Color}\left("XYZ",\mathrm{Convert}\left(\left[0.75,1.01,1.01\right],"RGB","XYZ"\right)\right)$
 ${C}{≔}{⟨}\colorbox[rgb]{0.749019607843137,1,1}{*XYZ* : 0.766 0.916 1.1}{⟩}$ (1)
 > $\mathrm{ToDisplayable}\left(C\right)$
 ${⟨}\colorbox[rgb]{0.749019607843137,1,1}{XYZ : 0.753 0.898 1.08}{⟩}$ (2)
 > $\mathrm{ToDisplayable}\left(C,\mathrm{mode}="RGB"\right)$
 ${⟨}\colorbox[rgb]{0.749019607843137,1,1}{XYZ : 0.754 0.898 1.08}{⟩}$ (3)
 > $\mathrm{ToDisplayable}\left(C,\mathrm{mode}="HSV"\right)$
 ${⟨}\colorbox[rgb]{0.741176470588235,1,1}{XYZ : 0.749 0.896 1.08}{⟩}$ (4)

Compatibility

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