Description
I create 16 level grayscale test. sometimes display blank block .
What MCU/Processor/Board and compiler are you using?
esp32
esp-idf 4.2
lvgl 7.11
What do you want to achieve?
16 level grayscale test well.
What have you tried so far?
Code to reproduce
lv_style_init(&style);
lv_color_t color;
lv_obj_t *obj[16];
lv_style_set_radius(&style, LV_STATE_DEFAULT, 0);
// 16 level of grayscale
for (int i = 0; i < 16; i++) {
color = convert_grayscale_to_lv_color(i); // this is my api, it return LV_COLOR_MAKE(0xii, 0xii, 0xii);
obj[i] = lv_obj_create(lv_scr_act(),(i == 0) ? NULL : obj[i-1]);
lv_obj_add_style(obj[i], LV_OBJ_PART_MAIN, &style);
if (i < 8) {
lv_obj_set_pos(obj[i], (LV_HOR_RES_MAX / 8) * i, 0);
} else {
lv_obj_set_pos(obj[i], (LV_HOR_RES_MAX / 8) * (16 - i - 1),
(LV_VER_RES_MAX / 2));
}
lv_obj_set_size(obj[i], LV_HOR_RES_MAX / 8, (LV_VER_RES_MAX / 2));
lv_obj_set_style_local_bg_color(obj[i], LV_OBJ_PART_MAIN,
LV_STATE_DEFAULT, color);
lv_obj_set_style_local_border_opa(obj[i], LV_OBJ_PART_MAIN,
LV_STATE_DEFAULT, LV_OPA_TRANSP);
}
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.
correct (70%)
fail (30%) : sometimes some gray block is white
Thanks