S or /

SourceClass Color

from skia import Color
class Color:

32-bit ARGB color value, unpremultiplied. Color components are always in a known order. This is different from SkPMColor, which has its bytes in a configuration dependent order, to match the format of BGRA 8888 color type bitmaps. Color is the type used to specify colors in skia.Paint and in gradients.

Color that is premultiplied has the same component values as color that is unpremultiplied if alpha is 255, fully opaque, although it may have the component values in a different order.

Properties§

Source@property def a(self, /) -> int§

Returns the alpha byte from the color value.

Source@property def b(self, /) -> int§

Returns the blue component of the color, from zero to 255.

Source@property def g(self, /) -> int§

Returns the green component of the color, from zero to 255.

Source@property def r(self, /) -> int§

Returns the red component of the color, from zero to 255.

Methods§

@classmethod def from_components(cls, /, r: int, g: int, b: int, a: int) -> Color§
@classmethod def from_u32(cls, /, color: int) -> Color§
@classmethod def parse(cls, /, color: Any) -> Color§