Function extractColorAndAlpha

  • Converts a CSS color string into an anonymous object with color and alpha properties.

    Parameters

    • color: string

      Color in any CSS format.

    Returns {
        alpha: number;
        color: string;
    }

    } An anonymous object with the properties color and alpha. The color property is a string in hex format and the alpha property is a number from 0.0 to 1.0, rounded to 3 decimal places.

    • alpha: number
    • color: string