Bases: eqx.Module
RGB in [0,1]. Helpers to convert to pygame-friendly formats.
r
instance-attribute
r: Float[Array, ''] = jnp.asarray(r)
g
instance-attribute
g: Float[Array, ''] = jnp.asarray(g)
b
instance-attribute
b: Float[Array, ''] = jnp.asarray(b)
__init__
__init__(
r: Float[ArrayLike, ""],
g: Float[ArrayLike, ""],
b: Float[ArrayLike, ""],
)
to_tuple
to_tuple() -> tuple[
Float[ArrayLike, ""],
Float[ArrayLike, ""],
Float[ArrayLike, ""],
]
to_rgb255
to_rgb255() -> tuple[int, int, int]
from_hex
classmethod
from_hex(hex_str: str) -> Color
from_rgb255
classmethod
from_rgb255(r: int, g: int, b: int) -> Color
from_tuple
classmethod
from_tuple(
rgb: tuple[
Float[ArrayLike, ""],
Float[ArrayLike, ""],
Float[ArrayLike, ""],
],
) -> Color