Color

Represents an RGBA color.

Constructor

  • Color() Color
  • Color(
        r: SupportsInt,
        g: SupportsInt,
        b: SupportsInt,
        a: SupportsInt = 255
    ) Color
  • Color(hex: str) Color

Represents an RGBA color.

Properties


NameDescriptionType
BLACKColor(0, 0, 0, 255)ClassVar[Color]
BLUEColor(0, 0, 255, 255)ClassVar[Color]
BROWNColor(139, 69, 19, 255)ClassVar[Color]
CYANColor(0, 255, 255, 255)ClassVar[Color]
DARK_GRAYColor(64, 64, 64, 255)ClassVar[Color]
DARK_GREYColor(64, 64, 64, 255)ClassVar[Color]
GRAYColor(128, 128, 128, 255)ClassVar[Color]
GREENColor(0, 255, 0, 255)ClassVar[Color]
GREYColor(128, 128, 128, 255)ClassVar[Color]
LIGHT_GRAYColor(192, 192, 192, 255)ClassVar[Color]
LIGHT_GREYColor(192, 192, 192, 255)ClassVar[Color]
MAGENTAColor(255, 0, 255, 255)ClassVar[Color]
MAROONColor(128, 0, 0, 255)ClassVar[Color]
NAVYColor(0, 0, 128, 255)ClassVar[Color]
OLIVEColor(128, 128, 0, 255)ClassVar[Color]
ORANGEColor(255, 165, 0, 255)ClassVar[Color]
PINKColor(255, 192, 203, 255)ClassVar[Color]
PURPLEColor(128, 0, 128, 255)ClassVar[Color]
REDColor(255, 0, 0, 255)ClassVar[Color]
TEALColor(0, 128, 128, 255)ClassVar[Color]
WHITEColor(255, 255, 255, 255)ClassVar[Color]
YELLOWColor(255, 255, 0, 255)ClassVar[Color]
aAlpha (transparency) channel value.int
bBlue channel value.int
gGreen channel value.int
hexGet or set the color as a hex string.str
hsvGet or set the color as an HSV tuple.tuple[float, float, float, float]
rRed channel value.int

Methods


Copy

copy() Color

Create a copy of the color.

Returns

Color : A new Color object with the same RGBA values.