mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-05 22:39:04 +00:00
ADSB RX text color bugfix
ADSB RX entries now "age" after 10 and 20 seconds
This commit is contained in:
+14
-5
@@ -26,14 +26,23 @@
|
||||
|
||||
namespace ui {
|
||||
|
||||
Color term_colors[8] = {
|
||||
// CGA palette
|
||||
Color term_colors[16] = {
|
||||
Color::black(),
|
||||
Color::red(),
|
||||
Color::green(),
|
||||
Color::yellow(),
|
||||
Color::dark_blue(),
|
||||
Color::dark_green(),
|
||||
Color::dark_cyan(),
|
||||
Color::dark_red(),
|
||||
Color::dark_magenta(),
|
||||
Color::dark_yellow(),
|
||||
Color::light_grey(),
|
||||
Color::dark_grey(),
|
||||
Color::blue(),
|
||||
Color::magenta(),
|
||||
Color::green(),
|
||||
Color::cyan(),
|
||||
Color::red(),
|
||||
Color::magenta(),
|
||||
Color::yellow(),
|
||||
Color::white()
|
||||
};
|
||||
|
||||
|
||||
@@ -104,10 +104,16 @@ struct Color {
|
||||
static constexpr Color cyan() {
|
||||
return { 0, 255, 255 };
|
||||
}
|
||||
static constexpr Color dark_cyan() {
|
||||
return { 0, 127, 127 };
|
||||
}
|
||||
|
||||
static constexpr Color magenta() {
|
||||
return { 255, 0, 255 };
|
||||
}
|
||||
static constexpr Color dark_magenta() {
|
||||
return { 127, 0, 127 };
|
||||
}
|
||||
|
||||
static constexpr Color white() {
|
||||
return { 255, 255, 255 };
|
||||
@@ -128,7 +134,7 @@ struct Color {
|
||||
}
|
||||
};
|
||||
|
||||
extern Color term_colors[8];
|
||||
extern Color term_colors[16];
|
||||
|
||||
struct ColorRGB888 {
|
||||
uint8_t r;
|
||||
|
||||
@@ -51,8 +51,10 @@ int Painter::draw_string(Point p, const Font& font, const Color foreground,
|
||||
|
||||
for(const auto c : text) {
|
||||
if (escape) {
|
||||
pen = term_colors[c & 7];
|
||||
if (!c) pen = foreground;
|
||||
if (c <= 15)
|
||||
pen = term_colors[c & 15];
|
||||
else
|
||||
pen = foreground;
|
||||
escape = false;
|
||||
} else {
|
||||
if (c == '\x1B') {
|
||||
|
||||
Reference in New Issue
Block a user