mosstool.util.color

Module Contents

Functions

hex_to_rgba

Convert a hex color code to an rgba color code.

Data

API

mosstool.util.color.__all__

[‘hex_to_rgba’]

mosstool.util.color.hex_to_rgba(hex: str, alpha: Union[float, int] = 255) list[int]

Convert a hex color code to an rgba color code.

Args:

  • hex: The hex color code to be converted.

  • alpha: The alpha value of the rgba color code.

Returns:

  • The rgba color code [r, g, b, a].