ColorTools
Convert
efficiently convert between color spaces
Calling Sequence
Parameters
Description
Examples
Compatibility
Convert(color, outspace)
Convert(color, inspace, outspace)
color
-
color format recognized by ColorTools or an rtable of floats
outspace
string specifying a known color space or "RGB24"
inspace
(optional) string specifying a known color space or "RGB24". Defaults to "RGB" or, if color is an object, its color space.
The primary purpose of the Convert command is to efficiently convert colors represented as lists of floating-point numbers from one color space to another. However, the color argument can be any supported color format. If only one color space is specified, then the input space is assumed to be "RGB" unless the input color is a Color object. In addition to all the color spaces supported for Color objects, the Convert command also allows "RGB24" to be used as the inspace or outspace.
If color is an rtable it will be interpreted as an n x 3 array of color coordinates in the input space and an n x 3 array of coordinates in the output space will be returned.
with⁡ColorTools:
Convert⁡1,0,0,HSV
0.,1.000000000,1.00000000
Convert⁡1,0,0,RGB,HSV
Convert⁡0.25,1,1,HSV,RGB24
128,255,0
If inspace is not given, the input is assumed to be RGB.
Convert⁡0.25,1,1,RGB24
64,255,255
Color object inputs implicitly specify inspace.
Convert⁡Color⁡HSV,0.25,1,1,RGB24
The ColorTools[Convert] command was introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
The ColorTools[Convert] command was updated in Maple 2022.
The outspace and inspace parameters were updated in Maple 2022.
See Also
ColorTools/ColorSpaces
ColorTools[Color]
Download Help Document