Tweak gamma on ST7789 and match UI colors

This change will increase the color accuracy of the PineTime and make UI
development with the simulator easier.
This commit is contained in:
Riku Isokoski 2022-04-22 23:26:38 +03:00
parent 5e83a862db
commit aa32159c00
29 changed files with 96 additions and 88 deletions

View file

@ -10,17 +10,17 @@ lv_color_t Pinetime::Applications::Convert(Pinetime::Controllers::Settings::Colo
case Pinetime::Controllers::Settings::Colors::Gray: return LV_COLOR_GRAY;
case Pinetime::Controllers::Settings::Colors::Black: return LV_COLOR_BLACK;
case Pinetime::Controllers::Settings::Colors::Red: return LV_COLOR_RED;
case Pinetime::Controllers::Settings::Colors::Maroon: return LV_COLOR_MAROON;
case Pinetime::Controllers::Settings::Colors::Maroon: return lv_color_lighten(LV_COLOR_MAROON, LV_OPA_20);
case Pinetime::Controllers::Settings::Colors::Yellow: return LV_COLOR_YELLOW;
case Pinetime::Controllers::Settings::Colors::Olive: return LV_COLOR_OLIVE;
case Pinetime::Controllers::Settings::Colors::Olive: return lv_color_lighten(LV_COLOR_OLIVE, LV_OPA_20);
case Pinetime::Controllers::Settings::Colors::Lime: return LV_COLOR_LIME;
case Pinetime::Controllers::Settings::Colors::Green: return LV_COLOR_GREEN;
case Pinetime::Controllers::Settings::Colors::Green: return lv_color_lighten(LV_COLOR_GREEN, LV_OPA_20);
case Pinetime::Controllers::Settings::Colors::Cyan: return LV_COLOR_CYAN;
case Pinetime::Controllers::Settings::Colors::Teal: return LV_COLOR_TEAL;
case Pinetime::Controllers::Settings::Colors::Teal: return lv_color_lighten(LV_COLOR_TEAL, LV_OPA_20);
case Pinetime::Controllers::Settings::Colors::Blue: return LV_COLOR_BLUE;
case Pinetime::Controllers::Settings::Colors::Navy: return LV_COLOR_NAVY;
case Pinetime::Controllers::Settings::Colors::Navy: return lv_color_lighten(LV_COLOR_NAVY, LV_OPA_20);
case Pinetime::Controllers::Settings::Colors::Magenta: return LV_COLOR_MAGENTA;
case Pinetime::Controllers::Settings::Colors::Purple: return LV_COLOR_PURPLE;
case Pinetime::Controllers::Settings::Colors::Purple: return lv_color_lighten(LV_COLOR_PURPLE, LV_OPA_20);
case Pinetime::Controllers::Settings::Colors::Orange: return LV_COLOR_ORANGE;
default: return LV_COLOR_WHITE;
}

View file

@ -113,9 +113,9 @@ static void basic_init(void) {
style_init_reset(&style_btn);
lv_style_set_radius(&style_btn, LV_STATE_DEFAULT, 10);
lv_style_set_bg_opa(&style_btn, LV_STATE_DEFAULT, LV_OPA_COVER);
lv_style_set_bg_color(&style_btn, LV_STATE_DEFAULT, lv_color_hex(0x2F3540));
lv_style_set_bg_color(&style_btn, LV_STATE_CHECKED, LV_COLOR_GREEN);
lv_style_set_bg_color(&style_btn, LV_STATE_DISABLED, lv_color_hex(0x2F3540));
lv_style_set_bg_color(&style_btn, LV_STATE_DEFAULT, LV_PINETIME_BLUE);
lv_style_set_bg_color(&style_btn, LV_STATE_CHECKED, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
lv_style_set_bg_color(&style_btn, LV_STATE_DISABLED, LV_PINETIME_BLUE);
lv_style_set_bg_color(&style_btn, LV_STATE_DISABLED | LV_STATE_CHECKED, lv_color_hex3(0x888));
lv_style_set_border_color(&style_btn, LV_STATE_DEFAULT, theme.color_primary);
lv_style_set_border_width(&style_btn, LV_STATE_DEFAULT, 0);
@ -166,7 +166,7 @@ static void basic_init(void) {
style_init_reset(&style_scrollbar);
lv_style_set_bg_opa(&style_scrollbar, LV_STATE_DEFAULT, LV_OPA_COVER);
lv_style_set_radius(&style_scrollbar, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
lv_style_set_bg_color(&style_scrollbar, LV_STATE_DEFAULT, LV_PINETIME_LIGHT_GRAY);
lv_style_set_bg_color(&style_scrollbar, LV_STATE_DEFAULT, LV_COLOR_WHITE);
lv_style_set_size(&style_scrollbar, LV_STATE_DEFAULT, LV_HOR_RES / 80);
lv_style_set_pad_right(&style_scrollbar, LV_STATE_DEFAULT, LV_HOR_RES / 60);
@ -190,8 +190,8 @@ static void basic_init(void) {
style_init_reset(&style_ddlist_list);
lv_style_set_text_line_space(&style_ddlist_list, LV_STATE_DEFAULT, LV_VER_RES / 25);
lv_style_set_shadow_width(&style_ddlist_list, LV_STATE_DEFAULT, LV_VER_RES / 20);
lv_style_set_shadow_color(&style_ddlist_list, LV_STATE_DEFAULT, LV_PINETIME_GRAY);
lv_style_set_bg_color(&style_ddlist_list, LV_STATE_DEFAULT, LV_PINETIME_GRAY);
lv_style_set_shadow_color(&style_ddlist_list, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_style_set_bg_color(&style_ddlist_list, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
style_init_reset(&style_ddlist_selected);
lv_style_set_bg_opa(&style_ddlist_selected, LV_STATE_DEFAULT, LV_OPA_COVER);
@ -204,7 +204,7 @@ static void basic_init(void) {
style_init_reset(&style_sw_indic);
lv_style_set_bg_opa(&style_sw_indic, LV_STATE_DEFAULT, LV_OPA_COVER);
lv_style_set_bg_color(&style_sw_indic, LV_STATE_DEFAULT, LV_COLOR_GREEN);
lv_style_set_bg_color(&style_sw_indic, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
style_init_reset(&style_sw_knob);
lv_style_set_bg_opa(&style_sw_knob, LV_STATE_DEFAULT, LV_OPA_COVER);
@ -237,7 +237,7 @@ static void basic_init(void) {
lv_style_set_line_rounded(&style_arc_indic, LV_STATE_DEFAULT, true);
style_init_reset(&style_arc_bg);
lv_style_set_line_color(&style_arc_bg, LV_STATE_DEFAULT, LV_PINETIME_GRAY);
lv_style_set_line_color(&style_arc_bg, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_style_set_line_width(&style_arc_bg, LV_STATE_DEFAULT, LV_DPX(25));
lv_style_set_line_rounded(&style_arc_bg, LV_STATE_DEFAULT, true);
lv_style_set_pad_all(&style_arc_bg, LV_STATE_DEFAULT, LV_DPX(5));
@ -245,7 +245,7 @@ static void basic_init(void) {
lv_style_reset(&style_arc_knob);
lv_style_set_radius(&style_arc_knob, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
lv_style_set_bg_opa(&style_arc_knob, LV_STATE_DEFAULT, LV_OPA_COVER);
lv_style_set_bg_color(&style_arc_knob, LV_STATE_DEFAULT, LV_PINETIME_LIGHT_GRAY);
lv_style_set_bg_color(&style_arc_knob, LV_STATE_DEFAULT, LV_COLOR_WHITE);
lv_style_set_pad_all(&style_arc_knob, LV_STATE_DEFAULT, LV_DPX(5));
style_init_reset(&style_table_cell);

View file

@ -23,7 +23,7 @@ extern "C" {
#define LV_PINETIME_LIGHT lv_color_hex(0xf3f8fe)
#define LV_PINETIME_GRAY lv_color_hex(0x8a8a8a)
#define LV_PINETIME_LIGHT_GRAY lv_color_hex(0xc4c4c4)
#define LV_PINETIME_BLUE lv_color_hex(0x2f3540)
#define LV_PINETIME_BLUE lv_color_hex(0x5d697e)
#define LV_PINETIME_GREEN lv_color_hex(0x4cb242)
#define LV_PINETIME_RED lv_color_hex(0xd51732)

View file

@ -40,7 +40,7 @@ Alarm::Alarm(DisplayApp* app,
time = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76);
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
alarmHours = alarmController.Hours();
alarmMinutes = alarmController.Minutes();
@ -50,7 +50,7 @@ Alarm::Alarm(DisplayApp* app,
lblampm = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_font(lblampm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
lv_obj_set_style_local_text_color(lblampm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_text_color(lblampm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_label_set_text_static(lblampm, " ");
lv_label_set_align(lblampm, LV_LABEL_ALIGN_CENTER);
lv_obj_align(lblampm, lv_scr_act(), LV_ALIGN_CENTER, 0, 30);

View file

@ -33,7 +33,7 @@ BatteryInfo::BatteryInfo(Pinetime::Applications::DisplayApp* app, Pinetime::Cont
lv_obj_align(percent, nullptr, LV_ALIGN_CENTER, 0, -60);
voltage = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(voltage, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xC6A600));
lv_obj_set_style_local_text_color(voltage, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xff, 0xb0, 0x0));
lv_label_set_text_fmt(voltage, "%1i.%02i volts", batteryVoltage / 1000, batteryVoltage % 1000 / 10);
lv_label_set_align(voltage, LV_LABEL_ALIGN_CENTER);
lv_obj_align(voltage, nullptr, LV_ALIGN_CENTER, 0, 95);
@ -68,7 +68,7 @@ void BatteryInfo::Refresh() {
lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_YELLOW);
lv_label_set_text_static(status, "Battery low");
} else {
lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_GREEN);
lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
lv_label_set_text_static(status, "Discharging");
}

View file

@ -42,7 +42,7 @@ FirmwareValidation::FirmwareValidation(Pinetime::Applications::DisplayApp* app,
lv_obj_set_size(buttonValidate, 115, 50);
lv_obj_align(buttonValidate, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
lv_obj_set_event_cb(buttonValidate, ButtonEventHandler);
lv_obj_set_style_local_bg_color(buttonValidate, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x009900));
lv_obj_set_style_local_bg_color(buttonValidate, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
labelButtonValidate = lv_label_create(buttonValidate, nullptr);
lv_label_set_text_static(labelButtonValidate, "Validate");
@ -51,7 +51,7 @@ FirmwareValidation::FirmwareValidation(Pinetime::Applications::DisplayApp* app,
buttonReset->user_data = this;
lv_obj_set_size(buttonReset, 115, 50);
lv_obj_align(buttonReset, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
lv_obj_set_style_local_bg_color(buttonReset, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x990000));
lv_obj_set_style_local_bg_color(buttonReset, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0x0, 0x0));
lv_obj_set_event_cb(buttonReset, ButtonEventHandler);
labelButtonReset = lv_label_create(buttonReset, nullptr);

View file

@ -63,11 +63,11 @@ FlashLight::~FlashLight() {
void FlashLight::SetColors() {
if (isOn) {
lv_obj_set_style_local_bg_color(lv_scr_act(), LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
lv_obj_set_style_local_text_color(flashLight, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_text_color(flashLight, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
for (auto & i : indicators) {
lv_obj_set_style_local_bg_color(i, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_bg_color(i, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_obj_set_style_local_bg_color(i, LV_OBJ_PART_MAIN, LV_STATE_DISABLED, LV_COLOR_WHITE);
lv_obj_set_style_local_border_color(i, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_border_color(i, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
}
} else {
lv_obj_set_style_local_bg_color(lv_scr_act(), LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK);

View file

@ -37,9 +37,9 @@ HeartRate::HeartRate(Pinetime::Applications::DisplayApp* app,
lv_obj_set_style_local_text_font(label_hr, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76);
if (isHrRunning)
lv_obj_set_style_local_text_color(label_hr, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN);
lv_obj_set_style_local_text_color(label_hr, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
else
lv_obj_set_style_local_text_color(label_hr, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_text_color(label_hr, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_label_set_text_static(label_hr, "000");
lv_obj_align(label_hr, nullptr, LV_ALIGN_CENTER, 0, -40);
@ -97,12 +97,12 @@ void HeartRate::OnStartStopEvent(lv_event_t event) {
heartRateController.Start();
UpdateStartStopButton(heartRateController.State() != Controllers::HeartRateController::States::Stopped);
systemTask.PushMessage(Pinetime::System::Messages::DisableSleeping);
lv_obj_set_style_local_text_color(label_hr, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN);
lv_obj_set_style_local_text_color(label_hr, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
} else {
heartRateController.Stop();
UpdateStartStopButton(heartRateController.State() != Controllers::HeartRateController::States::Stopped);
systemTask.PushMessage(Pinetime::System::Messages::EnableSleeping);
lv_obj_set_style_local_text_color(label_hr, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_text_color(label_hr, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
}
}
}

View file

@ -26,7 +26,7 @@ bool InfiniPaint::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
selectColor = LV_COLOR_MAGENTA;
break;
case 1:
selectColor = LV_COLOR_GREEN;
selectColor = LV_COLOR_MAKE(0x0, 0xb0, 0x0);
break;
case 2:
selectColor = LV_COLOR_WHITE;

View file

@ -27,7 +27,7 @@ Label::Label(uint8_t screenID, uint8_t numScreens, Pinetime::Applications::Displ
pageIndicator = lv_line_create(lv_scr_act(), NULL);
lv_obj_set_style_local_line_width(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
lv_obj_set_style_local_line_color(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_line_color(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_obj_set_style_local_line_rounded(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, true);
lv_line_set_points(pageIndicator, pageIndicatorPoints, 2);
}

View file

@ -45,7 +45,7 @@ List::List(uint8_t screenID,
pageIndicator = lv_line_create(lv_scr_act(), NULL);
lv_obj_set_style_local_line_width(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
lv_obj_set_style_local_line_color(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_line_color(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_line_set_points(pageIndicator, pageIndicatorPoints, 2);
}
@ -68,7 +68,7 @@ List::List(uint8_t screenID,
if (applications[i].application != Apps::None) {
itemApps[i] = lv_btn_create(container1, nullptr);
lv_obj_set_style_local_bg_opa(itemApps[i], LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_20);
lv_obj_set_style_local_bg_opa(itemApps[i], LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_40);
lv_obj_set_style_local_radius(itemApps[i], LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 57);
lv_obj_set_style_local_bg_color(itemApps[i], LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_AQUA);

View file

@ -16,7 +16,7 @@ Meter::Meter(Pinetime::Applications::DisplayApp* app) : Screen(app) {
lv_obj_set_style_local_scale_end_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(255, 0, 0));
lv_obj_set_style_local_scale_grad_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(160, 0, 0));
lv_obj_set_style_local_line_width(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, 2);
lv_obj_set_style_local_line_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_SILVER);
lv_obj_set_style_local_line_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_obj_set_size(lmeter, 200, 200);
lv_obj_align(lmeter, nullptr, LV_ALIGN_CENTER, 0, 0);

View file

@ -12,7 +12,7 @@ namespace {
lv_obj_t* createLabel(const char* name, lv_obj_t* reference, lv_align_t align, lv_font_t* font, uint8_t x, uint8_t y) {
lv_obj_t* label = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_font(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font);
lv_obj_set_style_local_text_color(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_text_color(label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_label_set_text(label, name);
lv_obj_align(label, reference, align, x, y);

View file

@ -19,7 +19,7 @@ Motion::Motion(Pinetime::Applications::DisplayApp* app, Controllers::MotionContr
/*Add 3 data series*/
ser1 = lv_chart_add_series(chart, LV_COLOR_RED);
ser2 = lv_chart_add_series(chart, LV_COLOR_GREEN);
ser2 = lv_chart_add_series(chart, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
ser3 = lv_chart_add_series(chart, LV_COLOR_YELLOW);
lv_chart_init_points(chart, ser1, 0);
@ -28,7 +28,7 @@ Motion::Motion(Pinetime::Applications::DisplayApp* app, Controllers::MotionContr
lv_chart_refresh(chart); /*Required after direct set*/
label = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text_fmt(label, "X #FF0000 %d# Y #008000 %d# Z #FFFF00 %d#", 0, 0, 0);
lv_label_set_text_fmt(label, "X #FF0000 %d# Y #00B000 %d# Z #FFFF00 %d#", 0, 0, 0);
lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);
lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 10);
lv_label_set_recolor(label, true);
@ -53,7 +53,7 @@ void Motion::Refresh() {
lv_label_set_text_fmt(labelStep, "Steps %lu", motionController.NbSteps());
lv_label_set_text_fmt(label,
"X #FF0000 %d# Y #008000 %d# Z #FFFF00 %d#",
"X #FF0000 %d# Y #00B000 %d# Z #FFFF00 %d#",
motionController.X() / 0x10,
motionController.Y() / 0x10,
motionController.Z() / 0x10);

View file

@ -53,7 +53,7 @@ Music::Music(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Mus
lv_style_init(&btn_style);
lv_style_set_radius(&btn_style, LV_STATE_DEFAULT, 20);
lv_style_set_bg_color(&btn_style, LV_STATE_DEFAULT, LV_COLOR_AQUA);
lv_style_set_bg_opa(&btn_style, LV_STATE_DEFAULT, LV_OPA_20);
lv_style_set_bg_opa(&btn_style, LV_STATE_DEFAULT, LV_OPA_40);
btnVolDown = lv_btn_create(lv_scr_act(), nullptr);
btnVolDown->user_data = this;

View file

@ -192,7 +192,7 @@ void Navigation::Refresh() {
if (progress > 90) {
lv_obj_set_style_local_bg_color(barProgress, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_RED);
} else {
lv_obj_set_style_local_bg_color(barProgress, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_ORANGE);
lv_obj_set_style_local_bg_color(barProgress, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xff, 0xb0, 0x0));
}
}
}

View file

@ -181,7 +181,7 @@ Notifications::NotificationItem::NotificationItem(const char* title,
: mode {mode}, alertNotificationService {alertNotificationService}, motorController {motorController} {
lv_obj_t* container1 = lv_cont_create(lv_scr_act(), NULL);
lv_obj_set_style_local_bg_color(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x222222));
lv_obj_set_style_local_bg_color(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x30, 0x30, 0x30));
lv_obj_set_style_local_pad_all(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 10);
lv_obj_set_style_local_pad_inner(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 5);
lv_obj_set_style_local_border_width(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0);
@ -197,7 +197,7 @@ Notifications::NotificationItem::NotificationItem(const char* title,
lv_obj_align(alert_count, NULL, LV_ALIGN_IN_TOP_RIGHT, 0, 16);
lv_obj_t* alert_type = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(alert_type, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x888888));
lv_obj_set_style_local_text_color(alert_type, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
if(title == nullptr) {
lv_label_set_text_static(alert_type, "Notification");
} else {
@ -218,7 +218,7 @@ Notifications::NotificationItem::NotificationItem(const char* title,
switch (category) {
default: {
lv_obj_t* alert_subject = lv_label_create(container1, nullptr);
lv_obj_set_style_local_text_color(alert_subject, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_ORANGE);
lv_obj_set_style_local_text_color(alert_subject, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xff, 0xb0, 0x0));
lv_label_set_long_mode(alert_subject, LV_LABEL_LONG_BREAK);
lv_obj_set_width(alert_subject, LV_HOR_RES - 20);
lv_label_set_text(alert_subject, msg);
@ -226,7 +226,7 @@ Notifications::NotificationItem::NotificationItem(const char* title,
case Controllers::NotificationManager::Categories::IncomingCall: {
lv_obj_set_height(container1, 108);
lv_obj_t* alert_subject = lv_label_create(container1, nullptr);
lv_obj_set_style_local_text_color(alert_subject, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_ORANGE);
lv_obj_set_style_local_text_color(alert_subject, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xff, 0xb0, 0x0));
lv_label_set_long_mode(alert_subject, LV_LABEL_LONG_BREAK);
lv_obj_set_width(alert_subject, LV_HOR_RES - 20);
lv_label_set_text_static(alert_subject, "Incoming call from");
@ -244,7 +244,7 @@ Notifications::NotificationItem::NotificationItem(const char* title,
lv_obj_align(bt_accept, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
label_accept = lv_label_create(bt_accept, nullptr);
lv_label_set_text_static(label_accept, Symbols::phone);
lv_obj_set_style_local_bg_color(bt_accept, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN);
lv_obj_set_style_local_bg_color(bt_accept, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
bt_reject = lv_btn_create(lv_scr_act(), nullptr);
bt_reject->user_data = this;
@ -262,7 +262,7 @@ Notifications::NotificationItem::NotificationItem(const char* title,
lv_obj_align(bt_mute, NULL, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
label_mute = lv_label_create(bt_mute, nullptr);
lv_label_set_text_static(label_mute, Symbols::volumMute);
lv_obj_set_style_local_bg_color(bt_mute, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_bg_color(bt_mute, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
} break;
}

View file

@ -38,7 +38,7 @@ Steps::Steps(Pinetime::Applications::DisplayApp* app,
lv_obj_align(lSteps, nullptr, LV_ALIGN_CENTER, 0, -40);
lv_obj_t* lstepsL = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(lstepsL, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x111111));
lv_obj_set_style_local_text_color(lstepsL, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_label_set_text_static(lstepsL, "Steps");
lv_obj_align(lstepsL, lSteps, LV_ALIGN_OUT_BOTTOM_MID, 0, 5);

View file

@ -42,13 +42,13 @@ StopWatch::StopWatch(DisplayApp* app, System::SystemTask& systemTask)
time = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76);
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_label_set_text_static(time, "00:00");
lv_obj_align(time, lv_scr_act(), LV_ALIGN_CENTER, 0, -45);
msecTime = lv_label_create(lv_scr_act(), nullptr);
// lv_obj_set_style_local_text_font(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
lv_obj_set_style_local_text_color(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_text_color(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_label_set_text_static(msecTime, "00");
lv_obj_align(msecTime, lv_scr_act(), LV_ALIGN_CENTER, 0, 3);
@ -65,9 +65,9 @@ StopWatch::StopWatch(DisplayApp* app, System::SystemTask& systemTask)
lv_obj_set_event_cb(btnStopLap, stop_lap_event_handler);
lv_obj_set_size(btnStopLap, 115, 50);
lv_obj_align(btnStopLap, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
lv_obj_set_style_local_bg_color(btnStopLap, LV_BTN_PART_MAIN, LV_STATE_DISABLED, lv_color_hex(0x080808));
lv_obj_set_style_local_bg_color(btnStopLap, LV_BTN_PART_MAIN, LV_STATE_DISABLED, lv_color_hex(0x0b0b0b));
txtStopLap = lv_label_create(btnStopLap, nullptr);
lv_obj_set_style_local_text_color(txtStopLap, LV_BTN_PART_MAIN, LV_STATE_DISABLED, lv_color_hex(0x888888));
lv_obj_set_style_local_text_color(txtStopLap, LV_BTN_PART_MAIN, LV_STATE_DISABLED, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_label_set_text_static(txtStopLap, Symbols::stop);
lv_obj_set_state(btnStopLap, LV_STATE_DISABLED);
lv_obj_set_state(txtStopLap, LV_STATE_DISABLED);
@ -96,8 +96,8 @@ StopWatch::~StopWatch() {
void StopWatch::Reset() {
currentState = States::Init;
oldTimeElapsed = 0;
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_text_color(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_obj_set_style_local_text_color(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_label_set_text_static(time, "00:00");
lv_label_set_text_static(msecTime, "00");
@ -113,8 +113,8 @@ void StopWatch::Reset() {
void StopWatch::Start() {
lv_obj_set_state(btnStopLap, LV_STATE_DEFAULT);
lv_obj_set_state(txtStopLap, LV_STATE_DEFAULT);
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN);
lv_obj_set_style_local_text_color(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN);
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
lv_obj_set_style_local_text_color(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
lv_label_set_text_static(txtPlayPause, Symbols::pause);
lv_label_set_text_static(txtStopLap, Symbols::lapsFlag);
startTime = xTaskGetTickCount();

View file

@ -3,6 +3,6 @@
void Pinetime::Applications::Screens::SetRadioButtonStyle(lv_obj_t* checkbox) {
lv_obj_set_style_local_radius(checkbox, LV_CHECKBOX_PART_BULLET, LV_STATE_DEFAULT, LV_RADIUS_CIRCLE);
lv_obj_set_style_local_border_width(checkbox, LV_CHECKBOX_PART_BULLET, LV_STATE_CHECKED, 9);
lv_obj_set_style_local_border_color(checkbox, LV_CHECKBOX_PART_BULLET, LV_STATE_CHECKED, LV_COLOR_GREEN);
lv_obj_set_style_local_border_color(checkbox, LV_CHECKBOX_PART_BULLET, LV_STATE_CHECKED, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
lv_obj_set_style_local_bg_color(checkbox, LV_CHECKBOX_PART_BULLET, LV_STATE_CHECKED, LV_COLOR_WHITE);
}

View file

@ -78,12 +78,12 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen1() {
lv_label_set_recolor(label, true);
lv_label_set_text_fmt(label,
"#FFFF00 InfiniTime#\n\n"
"#444444 Version# %ld.%ld.%ld\n"
"#444444 Short Ref# %s\n"
"#444444 Build date#\n"
"#808080 Version# %ld.%ld.%ld\n"
"#808080 Short Ref# %s\n"
"#808080 Build date#\n"
"%s\n"
"%s\n\n"
"#444444 Bootloader# %s",
"#808080 Bootloader# %s",
Version::Major(),
Version::Minor(),
Version::Patch(),
@ -139,14 +139,14 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen2() {
lv_obj_t* label = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_recolor(label, true);
lv_label_set_text_fmt(label,
"#444444 Date# %02d/%02d/%04d\n"
"#444444 Time# %02d:%02d:%02d\n"
"#444444 Uptime#\n %02lud %02lu:%02lu:%02lu\n"
"#444444 Battery# %d%%/%03imV\n"
"#444444 Backlight# %s\n"
"#444444 Last reset# %s\n"
"#444444 Accel.# %s\n"
"#444444 Touch.# %x.%x.%x\n",
"#808080 Date# %02d/%02d/%04d\n"
"#808080 Time# %02d:%02d:%02d\n"
"#808080 Uptime#\n %02lud %02lu:%02lu:%02lu\n"
"#808080 Battery# %d%%/%03imV\n"
"#808080 Backlight# %s\n"
"#808080 Last reset# %s\n"
"#808080 Accel.# %s\n"
"#808080 Touch.# %x.%x.%x\n",
dateTimeController.Day(),
static_cast<uint8_t>(dateTimeController.Month()),
dateTimeController.Year(),
@ -177,14 +177,14 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen3() {
lv_label_set_recolor(label, true);
auto& bleAddr = bleController.Address();
lv_label_set_text_fmt(label,
"#444444 BLE MAC#\n"
"#808080 BLE MAC#\n"
" %02x:%02x:%02x:%02x:%02x:%02x"
"\n"
"#444444 LVGL Memory#\n"
" #444444 used# %d (%d%%)\n"
" #444444 max used# %lu\n"
" #444444 frag# %d%%\n"
" #444444 free# %d",
"#808080 LVGL Memory#\n"
" #808080 used# %d (%d%%)\n"
" #808080 max used# %lu\n"
" #808080 frag# %d%%\n"
" #808080 free# %d",
bleAddr[5],
bleAddr[4],
bleAddr[3],
@ -212,7 +212,7 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen4() {
lv_table_set_col_cnt(infoTask, 4);
lv_table_set_row_cnt(infoTask, maxTaskCount + 1);
lv_obj_set_style_local_pad_all(infoTask, LV_TABLE_PART_CELL1, LV_STATE_DEFAULT, 0);
lv_obj_set_style_local_border_color(infoTask, LV_TABLE_PART_CELL1, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_border_color(infoTask, LV_TABLE_PART_CELL1, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_table_set_cell_value(infoTask, 0, 0, "#");
lv_table_set_col_width(infoTask, 0, 30);
@ -269,11 +269,11 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen5() {
"under the terms of\n"
"the GNU General\n"
"Public License v3\n"
"#444444 Source code#\n"
"#808080 Source code#\n"
"#FFFF00 https://github.com/#\n"
"#FFFF00 InfiniTimeOrg/#\n"
"#FFFF00 InfiniTime#");
lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);
lv_obj_align(label, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
return std::make_unique<Screens::Label>(4, 5, app, label);
}
}

View file

@ -63,7 +63,7 @@ Tile::Tile(uint8_t screenID,
pageIndicator = lv_line_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_line_width(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
lv_obj_set_style_local_line_color(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_line_color(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
lv_line_set_points(pageIndicator, pageIndicatorPoints, 2);
}
@ -87,9 +87,9 @@ Tile::Tile(uint8_t screenID,
lv_obj_align(btnm1, NULL, LV_ALIGN_CENTER, 0, 10);
lv_obj_set_style_local_radius(btnm1, LV_BTNMATRIX_PART_BTN, LV_STATE_DEFAULT, 20);
lv_obj_set_style_local_bg_opa(btnm1, LV_BTNMATRIX_PART_BTN, LV_STATE_DEFAULT, LV_OPA_20);
lv_obj_set_style_local_bg_opa(btnm1, LV_BTNMATRIX_PART_BTN, LV_STATE_DEFAULT, LV_OPA_40);
lv_obj_set_style_local_bg_color(btnm1, LV_BTNMATRIX_PART_BTN, LV_STATE_DEFAULT, LV_COLOR_AQUA);
lv_obj_set_style_local_bg_opa(btnm1, LV_BTNMATRIX_PART_BTN, LV_STATE_DISABLED, LV_OPA_20);
lv_obj_set_style_local_bg_opa(btnm1, LV_BTNMATRIX_PART_BTN, LV_STATE_DISABLED, LV_OPA_40);
lv_obj_set_style_local_bg_color(btnm1, LV_BTNMATRIX_PART_BTN, LV_STATE_DISABLED, lv_color_hex(0x111111));
lv_obj_set_style_local_pad_all(btnm1, LV_BTNMATRIX_PART_BG, LV_STATE_DEFAULT, 0);
lv_obj_set_style_local_pad_inner(btnm1, LV_BTNMATRIX_PART_BG, LV_STATE_DEFAULT, 10);

View file

@ -55,7 +55,7 @@ Timer::Timer(DisplayApp* app, Controllers::TimerController& timerController)
time = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76);
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xb0, 0xb0, 0xb0));
uint32_t seconds = timerController.GetTimeRemaining() / 1000;
lv_label_set_text_fmt(time, "%02lu:%02lu", seconds / 60, seconds % 60);

View file

@ -79,7 +79,7 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app,
// Date - Day / Week day
label_date_day = lv_label_create(lv_scr_act(), NULL);
lv_obj_set_style_local_text_color(label_date_day, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xf0a500));
lv_obj_set_style_local_text_color(label_date_day, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xff, 0xb0, 0x0));
lv_label_set_text_fmt(label_date_day, "%s\n%02i", dateTimeController.DayOfWeekShortToString(), dateTimeController.Day());
lv_label_set_align(label_date_day, LV_LABEL_ALIGN_CENTER);
lv_obj_align(label_date_day, NULL, LV_ALIGN_CENTER, 50, 0);
@ -181,7 +181,7 @@ void WatchFaceAnalog::UpdateClock() {
void WatchFaceAnalog::SetBatteryIcon() {
auto batteryPercent = batteryPercentRemaining.Get();
if (batteryPercent == 100) {
lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN);
lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
} else {
lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
}

View file

@ -111,7 +111,7 @@ void WatchFaceDigital::Refresh() {
if (batteryPercentRemaining.IsUpdated()) {
auto batteryPercent = batteryPercentRemaining.Get();
if (batteryPercent == 100) {
lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN);
lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
} else {
lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
}

View file

@ -51,7 +51,7 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app,
lv_style_init(&btn_style);
lv_style_set_radius(&btn_style, LV_STATE_DEFAULT, buttonHeight / 4);
lv_style_set_bg_color(&btn_style, LV_STATE_DEFAULT, lv_color_hex(0x111111));
lv_style_set_bg_color(&btn_style, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x1c, 0x1c, 0x1c));
btn1 = lv_btn_create(lv_scr_act(), nullptr);
btn1->user_data = this;
@ -81,7 +81,7 @@ QuickSettings::QuickSettings(Pinetime::Applications::DisplayApp* app,
lv_obj_set_event_cb(btn3, ButtonEventHandler);
lv_btn_set_checkable(btn3, true);
lv_obj_add_style(btn3, LV_BTN_PART_MAIN, &btn_style);
lv_obj_set_style_local_bg_color(btn3, LV_BTN_PART_MAIN, LV_STATE_CHECKED, LV_COLOR_GREEN);
lv_obj_set_style_local_bg_color(btn3, LV_BTN_PART_MAIN, LV_STATE_CHECKED, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
lv_obj_set_size(btn3, buttonWidth, buttonHeight);
lv_obj_align(btn3, nullptr, LV_ALIGN_IN_BOTTOM_LEFT, buttonXOffset, 0);

View file

@ -123,8 +123,8 @@ void SettingShakeThreshold::UpdateSelected(lv_obj_t* object, lv_event_t event) {
vCalTime = xTaskGetTickCount();
lv_label_set_text_static(calLabel, "Ready!");
lv_obj_set_click(positionArc, false);
lv_obj_set_style_local_bg_color(calButton, LV_BTN_PART_MAIN, LV_STATE_CHECKED, LV_COLOR_GREEN);
lv_obj_set_style_local_bg_color(calButton, LV_BTN_PART_MAIN, LV_STATE_CHECKED, LV_COLOR_GREEN);
lv_obj_set_style_local_bg_color(calButton, LV_BTN_PART_MAIN, LV_STATE_CHECKED, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
lv_obj_set_style_local_bg_color(calButton, LV_BTN_PART_MAIN, LV_STATE_CHECKED, LV_COLOR_MAKE(0x0, 0xb0, 0x0));
} else if (lv_btn_get_state(calButton) == LV_BTN_STATE_RELEASED) {
calibrating = 0;
lv_obj_set_click(positionArc, true);

View file

@ -23,6 +23,7 @@ void St7789::Init() {
RowAddressSet();
DisplayInversionOn();
NormalModeOn();
SetGamma();
DisplayOn();
}
@ -114,6 +115,11 @@ void St7789::WriteToRam() {
WriteCommand(static_cast<uint8_t>(Commands::WriteToRam));
}
void St7789::SetGamma() {
WriteCommand(static_cast<uint8_t>(Commands::GammaSet));
WriteData(0x04);
}
void St7789::DisplayOff() {
WriteCommand(static_cast<uint8_t>(Commands::DisplayOff));
nrf_delay_ms(500);

View file

@ -43,6 +43,7 @@ namespace Pinetime {
void NormalModeOn();
void WriteToRam();
void SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
void SetGamma();
void WriteCommand(uint8_t cmd);
void WriteSpi(const uint8_t* data, size_t size);
@ -52,6 +53,7 @@ namespace Pinetime {
SleepOut = 0x11,
NormalModeOn = 0x13,
DisplayInversionOn = 0x21,
GammaSet = 0x26,
DisplayOff = 0x28,
DisplayOn = 0x29,
ColumnAddressSet = 0x2a,