Skip to content

ipygame.color

class Color()

def __init__(*args)

@property
def r() -> int

@r.setter
def r(value: int) -> None

@property
def g() -> int

@g.setter
def g(value: int) -> None

@property
def b() -> int

@b.setter
def b(value: int) -> None

@property
def a() -> int

@a.setter
def a(value: int) -> None

@property
def cmy() -> tuple[float, float, float]

CMY representation (0.0 – 1.0 each).

@cmy.setter
def cmy(value: tuple[float, float, float]) -> None

@classmethod
def from_cmy(cls, c: float, m: float, y: float) -> Self

@property
def hsva() -> tuple[float, float, float, float]

(hue 0-360, sat 0-100, value 0-100, alpha 0-100).

@hsva.setter
def hsva(value: tuple[float, float, float, float]) -> None

@classmethod
def from_hsva(cls, h: float, s: float, v: float, a: float = 100.0) -> Self

@property
def hsla() -> tuple[float, float, float, float]

(hue 0-360, sat 0-100, lightness 0-100, alpha 0-100).

@hsla.setter
def hsla(value: tuple[float, float, float, float]) -> None

@classmethod
def from_hsla(cls, h: float, s: float, l: float, a: float = 100.0) -> Self

@property
def i1i2i3() -> tuple[float, float, float]

@classmethod
def from_i1i2i3(cls, i1: float, i2: float, i3: float) -> Self

@property
def normalized() -> tuple[float, float, float, float]

@normalized.setter
def normalized(value: tuple[float, float, float, float]) -> None

@classmethod
def from_normalized(cls, r: float, g: float, b: float, a: float = 1.0) -> Self

@property
def hex() -> str

@classmethod
def from_hex(cls, h: str) -> Self

def normalize() -> tuple[float, float, float, float]

def correct_gamma(gamma: float) -> Color

def lerp(other: Color | tuple, t: float) -> Color

def grayscale() -> Color

def premul_alpha() -> Color

def update(*args) -> None