ToDisplayable - Maple Help

ColorTools

 ToDisplayable
 compute a nearby color that can be represented in RGB

 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

 > $\mathrm{with}\left(\mathrm{ColorTools}\right):$
 > $C≔\mathrm{Color}\left(\left[0.293,-0.128,0.132\right]\right)$
 ${C}{≔}{⟨}\colorbox[rgb]{0.309803921568627,0,0.172549019607843}{{*RGB* : 0.293 -0.128 0.132}}{⟩}$ (1)
 > $\mathrm{C1}≔\mathrm{ToDisplayable}\left(C\right)$
 ${\mathrm{C1}}{≔}{⟨}\colorbox[rgb]{0.309803921568627,0,0.172549019607843}{{RGB : 0.31 0 0.172}}{⟩}$ (2)
 > $\mathrm{C2}≔\mathrm{ToDisplayable}\left(C,\mathrm{mode}="Lab"\right)$
 ${\mathrm{C2}}{≔}{⟨}\colorbox[rgb]{0.215686274509804,0,0.113725490196078}{{RGB : 0.215 -0.00173 0.115}}{⟩}$ (3)
 > $\mathrm{C3}≔\mathrm{ToDisplayable}\left(C,\mathrm{mode}="HSV"\right)$
 ${\mathrm{C3}}{≔}{⟨}\colorbox[rgb]{0.294117647058824,0,0.180392156862745}{{RGB : 0.293 0 0.181}}{⟩}$ (4)
 > $\mathrm{C4}≔\mathrm{ToDisplayable}\left(C,\mathrm{mode}="RGB"\right)$
 ${\mathrm{C4}}{≔}{⟨}\colorbox[rgb]{0.294117647058824,0,0.133333333333333}{{RGB : 0.293 0 0.132}}{⟩}$ (5)
 > $\mathrm{C5}≔\mathrm{ToDisplayable}\left(C,\mathrm{mode}="RGBscale"\right)$
 ${\mathrm{C5}}{≔}{⟨}\colorbox[rgb]{0.419607843137255,0,0.258823529411765}{{RGB : 0.421 0 0.26}}{⟩}$ (6)
 > $\mathrm{Swatches}\left(\left[\mathrm{C1},\mathrm{C2},\mathrm{C3},\mathrm{C4},\mathrm{C5}\right],\mathrm{rows}=1\right)$

Compatibility

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