• Returns the converted hex color from the given rgb color

    Parameters

    • Optionalrgb: string | [r: number, g: number, b: number]

      the rgb color to inspect

    Returns string | undefined

    the converted hex color from the given rgb color

    rgbToHex('rgb(255, 0, 0)');    // '#ff0000'
    rgbToHex([255, 0, 0]); // '#ff0000'