Function rgbToHex

  • Convert RGB to hex color. (e.g. rgbToHex([255, 0, 0, 255, 128, 0]) -> ["#FF0000", "#FF8000"])

    Parameters

    • rgb: Uint8Array

      An array of RGB values.

    • OptionalallowShort: null | boolean

      Whether to allow short hex output.

    Returns string[]

    An array of hex color strings. (e.g. "#FF0000")