Represents colors that can be used with Addressable LEDs.
More...
#include <frc/util/Color8Bit.h>
|
int | red = 0 |
| Red component (0-255).
|
|
int | green = 0 |
| Green component (0-255).
|
|
int | blue = 0 |
| Blue component (0-255).
|
|
Represents colors that can be used with Addressable LEDs.
◆ Color8Bit() [1/4]
frc::Color8Bit::Color8Bit |
( |
| ) |
|
|
constexprdefault |
Constructs a default color (black).
◆ Color8Bit() [2/4]
frc::Color8Bit::Color8Bit |
( |
int | r, |
|
|
int | g, |
|
|
int | b ) |
|
inlineconstexpr |
Constructs a Color8Bit.
- Parameters
-
r | Red value (0-255) |
g | Green value (0-255) |
b | Blue value (0-255) |
◆ Color8Bit() [3/4]
frc::Color8Bit::Color8Bit |
( |
const Color & | color | ) |
|
|
inlineconstexpr |
◆ Color8Bit() [4/4]
frc::Color8Bit::Color8Bit |
( |
std::string_view | hexString | ) |
|
|
inlineexplicitconstexpr |
Constructs a Color8Bit from a hex string.
- Parameters
-
hexString | a string of the format #RRGGBB |
- Throws:
- std::invalid_argument if the hex string is invalid.
◆ FromHexString()
static constexpr Color8Bit frc::Color8Bit::FromHexString |
( |
std::string_view | hexString | ) |
|
|
inlinestaticconstexpr |
Create a Color8Bit from a hex string.
- Parameters
-
hexString | a string of the format #RRGGBB |
- Returns
- Color8Bit object from hex string.
- Throws:
- std::invalid_argument if the hex string is invalid.
◆ HexString()
auto frc::Color8Bit::HexString |
( |
| ) |
const |
|
inlineconstexpr |
Return this color represented as a hex string.
- Returns
- a string of the format
#RRGGBB
◆ operator Color()
frc::Color8Bit::operator Color |
( |
| ) |
const |
|
inlineconstexpr |
◆ operator==()
bool frc::Color8Bit::operator== |
( |
const Color8Bit & | | ) |
const |
|
constexprdefault |
◆ blue
int frc::Color8Bit::blue = 0 |
◆ green
int frc::Color8Bit::green = 0 |
◆ red
int frc::Color8Bit::red = 0 |
The documentation for this class was generated from the following file: