Make hot/empty cold/full colors configurable
This commit is contained in:
+14
-4
@@ -89,16 +89,16 @@ static void temp_fuel_mg_update_proc_helper(Layer *layer, GContext *ctx, bool is
|
||||
graphics_context_set_fill_color(ctx, settings.ColorMGBars);
|
||||
graphics_fill_rect(ctx, bounds, 0, GCornerNone);
|
||||
if (isFuel) {
|
||||
graphics_context_set_stroke_color(ctx, GColorRed);
|
||||
graphics_context_set_stroke_color(ctx, settings.ColorBarsHot);
|
||||
} else {
|
||||
graphics_context_set_stroke_color(ctx, GColorDukeBlue);
|
||||
graphics_context_set_stroke_color(ctx, settings.ColorBarsCool);
|
||||
}
|
||||
const uint16_t bottom_color_y = bounds.origin.y + 183;
|
||||
graphics_draw_line(ctx, GPoint(bounds.origin.x + 1, bottom_color_y), GPoint(bounds.origin.x + s_bar_width, bottom_color_y));
|
||||
if (isFuel) {
|
||||
graphics_context_set_stroke_color(ctx, GColorDukeBlue);
|
||||
graphics_context_set_stroke_color(ctx, settings.ColorBarsCool);
|
||||
} else {
|
||||
graphics_context_set_stroke_color(ctx, GColorRed);
|
||||
graphics_context_set_stroke_color(ctx, settings.ColorBarsHot);
|
||||
}
|
||||
const uint16_t top_color_y = bounds.origin.y + 1;
|
||||
graphics_draw_line(ctx, GPoint(bounds.origin.x + 1, top_color_y), GPoint(bounds.origin.x + s_bar_width, top_color_y));
|
||||
@@ -305,6 +305,8 @@ static void inbox_received_handler(DictionaryIterator *iter, void *context) {
|
||||
Tuple *color_led_tuple = dict_find(iter, MESSAGE_KEY_CLAY_LED_COLOR);
|
||||
Tuple *color_bg_tuple = dict_find(iter, MESSAGE_KEY_CLAY_BG_COLOR);
|
||||
Tuple *color_mg_bar_tuple = dict_find(iter, MESSAGE_KEY_CLAY_BAR_MG_COLOR);
|
||||
Tuple *color_cool_bar_tuple = dict_find(iter, MESSAGE_KEY_CLAY_BAR_COOL_COLOR);
|
||||
Tuple *color_hot_bar_tuple = dict_find(iter, MESSAGE_KEY_CLAY_BAR_HOT_COLOR);
|
||||
Tuple *color_mg_time_tuple = dict_find(iter, MESSAGE_KEY_CLAY_TIME_MG_COLOR);
|
||||
Tuple *color_fg_tuple = dict_find(iter, MESSAGE_KEY_CLAY_FG_COLOR);
|
||||
Tuple *color_low_fuel_tuple = dict_find(iter, MESSAGE_KEY_CLAY_LOW_FUEL_COLOR);
|
||||
@@ -323,6 +325,12 @@ static void inbox_received_handler(DictionaryIterator *iter, void *context) {
|
||||
if (color_mg_bar_tuple) {
|
||||
settings.ColorMGBars = GColorFromHEX(color_mg_bar_tuple->value->int32);
|
||||
}
|
||||
if (color_cool_bar_tuple) {
|
||||
settings.ColorBarsCool = GColorFromHEX(color_cool_bar_tuple->value->int32);
|
||||
}
|
||||
if (color_hot_bar_tuple) {
|
||||
settings.ColorBarsHot = GColorFromHEX(color_hot_bar_tuple->value->int32);
|
||||
}
|
||||
if (color_mg_time_tuple) {
|
||||
settings.ColorMGTime = GColorFromHEX(color_mg_time_tuple->value->int32);
|
||||
}
|
||||
@@ -346,6 +354,8 @@ static void init() {
|
||||
settings.ColorLED = GColorWhite;
|
||||
settings.ColorBG = GColorBlue;
|
||||
settings.ColorMGBars = GColorDarkGray;
|
||||
settings.ColorBarsCool = GColorDukeBlue;
|
||||
settings.ColorBarsHot = GColorRed;
|
||||
settings.ColorMGTime = GColorDarkGray;
|
||||
settings.ColorFG = GColorWhite;
|
||||
settings.ColorLowFuel = GColorChromeYellow;
|
||||
|
||||
Reference in New Issue
Block a user