convert/color
convert a color to a different format
Calling Sequence
Parameters
Description
Examples
Compatibility
convert( incolor, 'color')
convert( incolor, 'color', format)
convert( incolor, 'color', outspace)
convert( incolor, 'color', format, outspace)
convert( incolor, 'color', inspace, format)
incolor
-
any color format recognized by the ColorTools package
format
string or name specifying the output format, valid choices listed in below
outspace
string specifying a color space use when format is object or list, defaults to "RGB"
inspace
string specifying an input color space when incolor is a list of numbers, defaults to "RGB"
This conversion is a flexible wrapper to ColorTools:-Convert and the other various conversions in the ColorTools package.
Valid values for format are
"list", a list of coordinates, the default if incolor is not an object or outspace is RGB24
"object", a ColorTools:-Color object, the default if incolor is an object and outspace is not RGB24
"hex", a hexadecimal representation of the color as a string using ColorTools:-RGB24ToHex
"colorname", a string that is the name of a color known by ColorTools using ColorTools:-RGB24ToName first with no options, then with palette=all if that fails
"plotcolor", a data structure used internally by plots, (previously undocumented as the colorRGB conversion) using ColorTools:-ToPlotColor
If the second argument is a color space, a list of coordinates is the default, unless the color is an object
"RGB24" is not a color space supported by color objects, so is always returned as a list of integers
If the input is a list of numbers, it's assumed to be RGB unless an input color space is also specified
convert raises an error if an input color space is given for anything other than a list of numbers
Error, (in `convert/color`) invalid input: an input colorspace can only be specified when the input is given as a list of coordinates
The convert/color command was introduced in Maple 2023.
For more information on Maple 2023 changes, see Updates in Maple 2023.
See Also
convert
Download Help Document