Color8Bit

class wpilib.Color8Bit(*args, **kwargs)

Bases: pybind11_object

Represents colors that can be used with Addressable LEDs.

Overloaded function.

  1. __init__(self: wpilib._wpilib.Color8Bit) -> None

Constructs a default color (black).

  1. __init__(self: wpilib._wpilib.Color8Bit, red: int, green: int, blue: int) -> None

Constructs a Color8Bit.

Parameters:
  • red – Red value (0-255)

  • green – Green value (0-255)

  • blue – Blue value (0-255)

  1. __init__(self: wpilib._wpilib.Color8Bit, color: wpilib._wpilib.Color) -> None

Constructs a Color8Bit from a Color.

Parameters:

color – The color

  1. __init__(self: wpilib._wpilib.Color8Bit, hexString: str) -> None

Constructs a Color8Bit from a hex string.

Parameters:

hexString – a string of the format <tt>#RRGGBB</tt> @throws std::invalid_argument if the hex string is invalid.

property blue int

Blue component (0-255).

static fromHexString(hexString: str) wpilib._wpilib.Color8Bit

Create a Color8Bit from a hex string.

Parameters:

hexString – a string of the format <tt>#RRGGBB</tt>

Returns:

Color8Bit object from hex string. @throws std::invalid_argument if the hex string is invalid.

property green int

Green component (0-255).

hexString() str

Return this color represented as a hex string.

Returns:

a string of the format <tt>#RRGGBB</tt>

property red int

Red component (0-255).

toColor() wpilib._wpilib.Color