Transform a color string to an array of rgba values.

  • Parameters

    • color: string

      A string representing a color. Can be of type hex ('#0033ff') or rgb(a) ('rgba(255, 23, 15, 0.5)').

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

    an array of rgba values: R, G, B [0-255] and alpha [0-1]. Or null if the color isn't in a valid format.