RGB24ToHex - Maple Help

# Online Help

###### All Products    Maple    MapleSim

ColorTools

 RGB24ToHex
 convert RGB values to a hex code

 Calling Sequence RGB24ToHex(rgb) RGB24ToHex(rgb, omitoctothorpe)

Parameters

 rgb - list; [r,g,b] color values, integer values 0-255

Options

 • omitoctothorpe : if this keyword is included, then an octothorpe (#) is not prepended to the output string.

Description

 • The RGB24ToHex procedure converts from RGB values to a hex code. If the input is not a valid list of RGB values, an error occurs.
 • The value returned is a six-digit hex code for color in the form "#rrggbb" or "rrggbb" using numbers and uppercase letters.

Examples

 > $\mathrm{with}\left(\mathrm{ColorTools}\right):$
 > $\mathrm{RGB24ToHex}\left(\left[0,255,0\right]\right)$
 ${"#00FF00"}$ (1)
 > $\mathrm{RGB24ToHex}\left(\mathrm{HexToRGB24}\left("#badcab"\right),'\mathrm{omitoctothorpe}'\right)$
 ${"BADCAB"}$ (2)

Compatibility

 • The ColorTools[RGB24ToHex] command was introduced in Maple 16.
 • For more information on Maple 16 changes, see Updates in Maple 16.

 See Also