colorRGBToHex function

Syntax

  • string colorRGBToHex(red, green, blue)

Parameters

  1. redfloat (range[0, ])
    Red value of RGB color.
  2. greenfloat (range[0,1])
    Green value of RGB color.
  3. bluefloat (range[0,1])
    Blue value of RGB color.

Returns

Returns hexadecimal color string (format: "#rrggbb") for RGB color in [0,1].

Description

The colorRGBToHex converts an RGB color to a hexadecimal color string. It clamps red, green, and blue to the range [0,1].

Related

Examples

colorRGBToHex(0,0.5,1)
# result = "#0080FF"