ADSB RX text color bugfix

ADSB RX entries now "age" after 10 and 20 seconds
This commit is contained in:
furrtek
2017-08-27 21:03:17 +01:00
parent a08ee18e3b
commit 3aae333974
7 changed files with 85 additions and 26 deletions
+14 -5
View File
@@ -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()
};
+7 -1
View File
@@ -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;
+4 -2
View File
@@ -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') {