Function rgbaToHex

  • Convert RGBA to hex color. (e.g. rgbaToHex([255, 0, 0, 255, 255, 128, 0, 128]) -> ["#FF0000", "#FF800080"])

    Parameters

    • rgba: Uint8Array

      An array of RGBA values.

    • OptionalalwaysIncludeAlpha: null | boolean

      Whether to always include the alpha channel in the output.

    • OptionalallowShort: null | boolean

      Whether to allow short hex output.

    Returns string[]

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