Transforms a hex string into rgba values.

  • Parameters

    • hex: string

      A hex color, starting with '#' and including 3 (=shorthand), 6 (=default) or 8 (=including alpha) values.

    Returns null | [number, number, number, number]

    an array of rgba values: R, G, B [0-255], alpha [0-1]. Or null if the hex color is invalid.