Skip to content

Function: rgbToHex() ​

ts
function rgbToHex(__namedParameters): string;

Converts an RgbColor object to a lowercase hex string.

Parameters ​

ParameterType
__namedParametersRgbColor

Returns ​

string

Example ​

ts
rgbToHex({ r: 255, g: 102, b: 0 }) // => '#ff6600'

Since ​

1.0.0

Released under the MIT License.