Skip to content

Function: toHexString()

ts
function toHexString(color): string;

Converts an RgbColor object to a hex string (alias of rgbToHex).

Parameters

ParameterType
colorRgbColor

Returns

string

Example

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

Since

1.0.0

Released under the MIT License.