Implements colors and tests.
This commit is contained in:
@@ -3,24 +3,47 @@
|
||||
namespace SBF {
|
||||
|
||||
// TODO: Update these if they're wrong. They should be the initial color pair.
|
||||
static uint8_t g_foregroundColor = kColorDarkWhite;
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunused-variable"
|
||||
static uint8_t g_backgroundColor = kColorDarkBlack;
|
||||
uint8_t g_foregroundColor = kColorDarkWhite;
|
||||
uint8_t g_backgroundColor = kColorDarkBlack;
|
||||
#pragma clang diagnostic pop
|
||||
static uint16_t g_color;
|
||||
|
||||
void SetForegroundColor(uint8_t foregroundColor) {
|
||||
g_foregroundColor = foregroundColor;
|
||||
// TODO: update g_color with g_foregroundColor and g_backgroundColor.
|
||||
// void SetForegroundColor(uint8_t foregroundColor) {
|
||||
// g_foregroundColor = foregroundColor;
|
||||
// // TODO: update g_color with g_foregroundColor and g_backgroundColor.
|
||||
// }
|
||||
// uint8_t GetForegroundColor() {
|
||||
// return g_foregroundColor;
|
||||
// }
|
||||
|
||||
// // ncurses color pair
|
||||
// uint16_t GetColor() {
|
||||
// return g_color;
|
||||
// }
|
||||
|
||||
void FillColors(std::vector<uint8_t>& colors) {
|
||||
colors.clear();
|
||||
for (uint8_t color = kColorDarkBlack; color <= kColorBrightWhite; color++) {
|
||||
colors.push_back(color);
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t GetBackgroundColor() {
|
||||
return g_backgroundColor;
|
||||
}
|
||||
|
||||
uint8_t GetForegroundColor() {
|
||||
return g_foregroundColor;
|
||||
}
|
||||
|
||||
// ncurses color pair
|
||||
uint16_t GetColor() {
|
||||
return g_color;
|
||||
// TODO: Define what happens when color is invalid.
|
||||
void SetBackgroundColor(uint8_t color) {
|
||||
g_backgroundColor = color;
|
||||
}
|
||||
|
||||
// TODO: Define what happens when color is invalid.
|
||||
void SetForegroundColor(uint8_t color) {
|
||||
g_foregroundColor = color;
|
||||
}
|
||||
} // End namespace SBF
|
||||
|
||||
Reference in New Issue
Block a user