Colouring issue like #862

Hi,
I am having the exact same issue as described in bug report below

Even if set the font color to white, it is alway kinda of grey. All the images I create have clear white but font and bar have this grayish color.
Please let me know if there is any solution for it!

Does this happen on the PC simulator with the same fonts and color depth?

I don’t use the simulator. It is exactly the sane issue that seems to be resolved in the girhub issue link above but the links for forum for that is broken. It is not just the fonts the bars background color also never turns to be clear white. I need maximum contrast would be appreciated if someone help me out with this

It would be good if you could try it in the simulator, to rule out the possibility of a hardware issue. Otherwise, you could try printing the values of the colors in your flush_cb function.

I dont think it is a hardware issue since imported pictures ( the lock icon for example) are clear white color.

If you create a single fullscreen object and then use lv_style_scr on it, is that object white?

With that object on screen, try my other suggestion (checking the color values passed to flush_cb). What values do you see?

Will do that and get back with results shortly thanks

I am running the code on nrf52 and there is some dependencies that I cannot disable ble which has independent watchdog makes it hard to debug,
In these photo you can see how fonts are kinda grayish. In the gothub issue I shared seems this issue has been resolved but the link to the forum os broken not sure what else I can do

I even set the LV_VDB_SIZE to zero so no disp_flush function gets called still same issue

Do you use the latest version of the library?
There were some fixes that might be related.

1 Like

Other question:

  • Do you see the issue with the built-in fonts too?
  • Does the font have opacity != LV_OPA_COVER?
1 Like

Is the screen background white, though, or is it also gray?

I am one release behind of the repo.
I see the same issue with default fonts and as you can see in bar object which the color has been set to white but it turns out gray.

Some else also reported this in the github link above. Is this a bug in 5.2 that has been fixed in new release?

No when I set the screen background color to white it is pure white, fonts also has been set to white

Version 5.2 is old beyond verbal description. :wink: I suggest using 6.1 or at the very least 6.0; anything older than that isn’t really supported.

So a completely white label on top of a white background is not invisible? This is strange. Have you ensured that the font has full opacity as @kisvegabor mentioned?

Yes I set opa to LV_OPA_COVER ans no luck! I have this issue with Bar objects as well. You can see in the above picture their background is gray
Below is the cod snippet for the gauge and label which the font is grayed out

static lv_style_t thr_meter_style;
static lv_obj_t *thr_meter_obj;
static lv_obj_t *thr_percent_label_obj;

void create_thr_meter(void)
{
      /*Create a simple style with ticker line width*/
      lv_style_copy(&thr_meter_style, &lv_style_pretty_color);
      thr_meter_style.line.width = 5;
      thr_meter_style.line.color = LV_COLOR_WHITE;
      thr_meter_style.body.main_color = LV_COLOR_LIME;       
      thr_meter_style.body.grad_color = LV_COLOR_RED; 
      thr_meter_style.body.padding.hor = 10;  
      
      /*Create the first line meter */

      thr_meter_obj = lv_lmeter_create(main_screen, NULL);
      lv_lmeter_set_range(thr_meter_obj, 0, 50);                   /*Set the range*/
      lv_lmeter_set_scale(thr_meter_obj,240, 20);
      lv_lmeter_set_value(thr_meter_obj, 45);                       /*Set the current value*/
      lv_lmeter_set_style(thr_meter_obj, &thr_meter_style);           /*Apply the new style*/
      lv_obj_set_size(thr_meter_obj, 128,100);
      lv_obj_align(thr_meter_obj, gps_time_obj, LV_ALIGN_OUT_BOTTOM_MID, 0,5);


      static lv_style_t thr_percent_style;
      lv_style_copy(&thr_percent_style, &lv_style_plain_color);
      thr_percent_style.text.font   = &lv_font_dejavu_30;
      thr_percent_style.text.color = LV_COLOR_WHITE;
      thr_percent_style.text.opa   = LV_OPA_COVER;

      thr_percent_label_obj = lv_label_create(main_screen, NULL);
      lv_label_set_style(thr_percent_label_obj, &thr_percent_style);
      lv_label_set_text(thr_percent_label_obj, "100%");
      
      lv_obj_align(thr_percent_label_obj, thr_meter_obj, LV_ALIGN_IN_BOTTOM_MID,0,-25);

      static lv_style_t thr_min_max_style;
      lv_style_copy(&thr_min_max_style, &lv_style_pretty_color);
      thr_min_max_style.text.font = &lv_font_dejavu_10;
      thr_min_max_style.text.color = LV_COLOR_WHITE;
      thr_min_max_style.text.opa = LV_OPA_COVER;
}

v5.2 is really old. Would it be possible to update to the latest version from master? If your project is not super complex yet, you should be able to migrate quickly.

1 Like

I was trying to avoid it since I am happy with what I have on graphics currently. In my case Nrf52832 handling lots of tasks along with ble stack. But since this display is going to be used on day light I needed maximum contrast for better readability. If you don’t see any potential solution for this I will update to latest release and test again. I bet lots of api’s has changed since 5.2

v6.0 was API breaking. The big new things were the events.
You can read more about the changes here: https://github.com/littlevgl/lvgl/releases/tag/v6.0