Skip to content

Commit

Permalink
New themes (#2166)
Browse files Browse the repository at this point in the history
 green, red themes
  • Loading branch information
htotoo authored May 28, 2024
1 parent ced8012 commit 2bf1116
Show file tree
Hide file tree
Showing 3 changed files with 286 additions and 0 deletions.
2 changes: 2 additions & 0 deletions firmware/application/apps/ui_settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,8 @@ class SetThemeView : public View {
{"Default - Grey", 0},
{"Yellow", 1},
{"Aqua", 2},
{"Green", 3},
{"Red", 4},
}};

Checkbox checkbox_menuset{
Expand Down
272 changes: 272 additions & 0 deletions firmware/application/theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ void Theme::SetTheme(ThemeId theme) {
case Aqua:
current = new ThemeAqua();
break;
case Green:
current = new ThemeGreen();
break;
case Red:
current = new ThemeRed();
break;
case DefaultGrey:
default:
current = new ThemeDefault();
Expand Down Expand Up @@ -453,4 +459,270 @@ ThemeDefault::ThemeDefault() {
bg_table_header = new Color{0, 0, 255};
}

ThemeGreen::ThemeGreen() {
bg_lightest = new Style{
.font = font::fixed_8x16,
.background = {0, 245, 29},
.foreground = Color::black(),
};
bg_lightest_small = new Style{
.font = font::fixed_8x16,
.background = {0, 245, 29},
.foreground = Color::black(),
};
bg_light = new Style{
.font = font::fixed_8x16,
.background = {0, 212, 25},
.foreground = Color::white(),
};
bg_medium = new Style{
.font = font::fixed_8x16,
.background = {0, 143, 17},
.foreground = Color::white(),
};
bg_dark = new Style{
.font = font::fixed_8x16,
.background = {0, 99, 12},
.foreground = Color::white(),
};
bg_darker = new Style{
.font = font::fixed_8x16,
.background = {0, 79, 9},
.foreground = Color::white(),
};

bg_darkest = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = Color::white(),
};
bg_darkest_small = new Style{
.font = font::fixed_5x8,
.background = {0, 33, 4},
.foreground = Color::white(),
};

bg_important_small = new Style{
.font = ui::font::fixed_5x8,
.background = ui::Color::yellow(),
.foreground = {0, 33, 4},
};

error_dark = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = Color::red(),
};
warning_dark = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = Color::yellow(),
};
ok_dark = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = Color::green(),
};

fg_dark = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = {0, 99, 12},
};
fg_medium = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = {0, 143, 17},
};
fg_light = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = Color::light_grey(),
};

fg_red = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = Color::red(),
};
fg_green = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = Color::green(),
};
fg_yellow = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = Color::yellow(),
};
fg_orange = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = Color::orange(),
};
fg_blue = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = Color::blue(),
};
fg_cyan = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = Color::cyan(),
};
fg_darkcyan = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = Color::dark_cyan(),
};
fg_magenta = new Style{
.font = font::fixed_8x16,
.background = {0, 33, 4},
.foreground = Color::magenta(),
};

option_active = new Style{
.font = font::fixed_8x16,
.background = Color::orange(),
.foreground = Color::white(),
};

status_active = new Color{0, 255, 0}; // green, the status bar icons when active

bg_table_header = new Color{0, 205, 30};
}

ThemeRed::ThemeRed() {
bg_lightest = new Style{
.font = font::fixed_8x16,
.background = {245, 29, 0},
.foreground = Color::black(),
};
bg_lightest_small = new Style{
.font = font::fixed_8x16,
.background = {245, 29, 0},
.foreground = Color::black(),
};
bg_light = new Style{
.font = font::fixed_8x16,
.background = {212, 25, 0},
.foreground = Color::white(),
};
bg_medium = new Style{
.font = font::fixed_8x16,
.background = {143, 17, 0},
.foreground = Color::white(),
};
bg_dark = new Style{
.font = font::fixed_8x16,
.background = {99, 12, 0},
.foreground = Color::white(),
};
bg_darker = new Style{
.font = font::fixed_8x16,
.background = {79, 9, 0},
.foreground = Color::white(),
};

bg_darkest = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = Color::white(),
};
bg_darkest_small = new Style{
.font = font::fixed_5x8,
.background = {33, 4, 0},
.foreground = Color::white(),
};

bg_important_small = new Style{
.font = ui::font::fixed_5x8,
.background = ui::Color::yellow(),
.foreground = {33, 4, 0},
};

error_dark = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = Color::red(),
};
warning_dark = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = Color::yellow(),
};
ok_dark = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = Color::green(),
};

fg_dark = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = {99, 12, 0},
};
fg_medium = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = {143, 17, 0},
};
fg_light = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = Color::light_grey(),
};

fg_red = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = Color::red(),
};
fg_green = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = Color::green(),
};
fg_yellow = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = Color::yellow(),
};
fg_orange = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = Color::orange(),
};
fg_blue = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = Color::blue(),
};
fg_cyan = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = Color::cyan(),
};
fg_darkcyan = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = Color::dark_cyan(),
};
fg_magenta = new Style{
.font = font::fixed_8x16,
.background = {33, 4, 0},
.foreground = Color::magenta(),
};

option_active = new Style{
.font = font::fixed_8x16,
.background = Color::orange(),
.foreground = Color::white(),
};

status_active = new Color{0, 255, 0}; // green, the status bar icons when active

bg_table_header = new Color{205, 30, 0};
}

} // namespace ui
12 changes: 12 additions & 0 deletions firmware/application/theme.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,24 @@ class ThemeAqua : public ThemeTemplate {
ThemeAqua();
};

class ThemeGreen : public ThemeTemplate {
public:
ThemeGreen();
};

class ThemeRed : public ThemeTemplate {
public:
ThemeRed();
};

class Theme {
public:
enum ThemeId {
DefaultGrey = 0,
Yellow = 1,
Aqua = 2,
Green = 3,
Red = 4,
MAX
};
static ThemeTemplate* getInstance();
Expand Down

0 comments on commit 2bf1116

Please sign in to comment.