rgb_to_name()

Converts an RGB color value to its closest named color.

Syntax

color_name = rgb_to_name(color)

Parameters

Parameter Type Description Comment
color Number RGB color value in integer format (0xRRGGBB)

Return Value

Examples

Get the name of the color white

rgb_to_name(0xFFFFFF); // returns "White"

Get the name of the color black

rgb_to_name(0x000000); // returns "Black"

Get the name of the color red

rgb_to_name(0xFF0000); // returns "Red"

Get the name of a medium gray

rgb_to_name(0x808080); // returns 

Get the name of a light blue color (RGB: 173, 216, 230)

rgb_to_name(0xADD8E6); // returns 

See also

rgb_to_hue
rgb_to_saturation
rgb_to_lightness
rgb_to_name

cam_color