S or /

SourceClass Rgba

from egui import Rgba
class Rgba:

0-1 linear space RGBA color with premultiplied alpha.

See egui.Color32 for explanation of what "premultiplied alpha" means.

Constants§

BLACK: Final[Rgba]§
BLUE: Final[Rgba]§
GREEN: Final[Rgba]§
RED: Final[Rgba]§
TRANSPARENT: Final[Rgba]§
WHITE: Final[Rgba]§

Properties§

Source@property def a(self, /) -> float§
Source@property def b(self, /) -> float§
Source@property def g(self, /) -> float§
Source@property def r(self, /) -> float§

Methods§

Sourcedef additive(self, /) -> Rgba§

Return an additive version of this color (alpha = 0)

Sourcedef blend(self, /, on_top: Rgba) -> Rgba§

Blend two colors in linear space, so that self is behind the argument.

Source@staticmethod def from_black_alpha(a: float) -> Rgba§

Transparent black

@staticmethod def from_color32(color: Color32) -> Rgba§
Source@staticmethod def from_gray(l: float) -> Rgba§
@staticmethod def from_hsva(hsva: Hsva) -> Rgba§
@staticmethod def from_hsva_gamma(hsva_gamma: HsvaGamma) -> Rgba§
Source@staticmethod def from_luminance_alpha(l: float, a: float) -> Rgba§
Source@staticmethod def from_rgb(r: float, g: float, b: float) -> Rgba§
Source@staticmethod def from_rgba_premultiplied(r: float, g: float, b: float, a: float) -> Rgba§
Source@staticmethod def from_rgba_unmultiplied(r: float, g: float, b: float, a: float) -> Rgba§
Source@staticmethod def from_srgba_premultiplied(r: int, g: int, b: int, a: int) -> Rgba§
Source@staticmethod def from_srgba_unmultiplied(r: int, g: int, b: int, a: int) -> Rgba§
Source@staticmethod def from_white_alpha(a: float) -> Rgba§

Transparent white

Sourcedef intensity(self, /) -> float§

How perceptually intense (bright) is the color?

Sourcedef is_additive(self, /) -> bool§

Is the alpha=0 ?

Sourcedef multiply(self, /, alpha: float) -> Rgba§

Multiply with e.g. 0.5 to make us half transparent

Sourcedef to_array(self, /) -> tuple[float, float, float, float]§

Premultiplied RGBA

def to_color32(self, /) -> Color32§
def to_hsva(self, /) -> Hsva§
def to_hsva_gamma(self, /) -> HsvaGamma§
Sourcedef to_opaque(self, /) -> Rgba§

Returns an opaque version of self

Sourcedef to_rgba_unmultiplied(self, /) -> tuple[float, float, float, float]§

unmultiply the alpha

Sourcedef to_srgba_unmultiplied(self, /) -> tuple[int, int, int, int]§

unmultiply the alpha

Sourcedef to_tuple(self, /) -> tuple[float, float, float, float]§

Premultiplied RGBA