Hi everyone ,
i am setting the image color using the below code snippet.
lv_obj_t * scr = lv_disp_get_scr_act(NULL);
static lv_style_t style1;
style1.image.color = LV_COLOR_GREEN ;
lv_img_set_style(img_uno_mode, LV_IMG_STYLE_MAIN, &style1);
The above code is showing my image in the yellow using this “LV_COLOR_GREEN” and for showing image in green color i had to use LV_COLOR_YELLOW .
Can someone suggest me why this is happening in this way .?
What’s the original color of your image? It needs to be grayscale to start with, otherwise I think recoloring will give inaccurate results.
by default its showing in magenta color. i am using black background and also this percentage is not visible in the icons its covered with the icon color.
If it’s showing in magenta color by default then something is wrong with the way it’s being drawn. What settings did you use to convert it?
battery_100.c (8.8 KB)
I am using alpha only 16 shades. You can view my “battery_100.c” file for details.
Some important setting in “lv_conf.h” file i am using like below.
#define LV_COLOR_DEPTH 16
#define LV_COLOR_SCREEN_TRANSP 0
#define LV_COLOR_TRANSP LV_COLOR_LIME
#define LV_INDEXED_CHROMA 1
Are the other color are correct on your screen?
Depending on the type of communication with communication your display you might need
No colors are working exactly same how it defined in the color module .
example : LV_COLOR_GREEN is showing yellow color and LV_COLOR_YELLOW is showing green color. All are showing different color.
Unable to display the exact color of image on LCD.
For displaying a transparent image on LCD i am using Alpha only 16 shades method to generate. You can find the attached file above.
I have been facing this issue since long time and also getting very slow response from forum,Can you please suggest me where is the problem. ? If you need further details feel free to ask me .
If all the color are also wrong then the issue is probably unrelated to the images.
I suggest trying to find/figure out the color format of you display first without LVGL. E.g. what value you need write to the display to get pure RED or GREEN or BLUE?
For this do i need to contact to LCD hardware team.Is this is hardware concern ?
Possibly. The first thing to do is find out what color format your LCD expects and whether your driver is sending colors in that format or not.
I am using using ST7789S controller in MIDAS LCD and it support 3/4SPI+16/18Bit RGB color format.
and yes its sending 16bpp.I have given printf statement in my lcd driver “fbdev_flush”.
Is this any hardware issue or i am wrong in some lcd initialization part of LCD.
I don’t think we can answer that question accurately, as you are the most familiar with your hardware. Either of those could be the problem.
Can you confirm that littlevgl has support of lcd driver of controller ST7789S because i am not seeing any file ST7789S.c in “lv_drivers/display/” path of this controller support.
Am i correct ?
Please give your input on this ?
LVGL supports any display controller, as long as you have a driver for it. It’s a platform-agnostic library. The drivers in
lv_drivers are just examples provided by @kisvegabor and the community.
The following is my display initialization function
lv_disp_t * disp;
/*Linux frame buffer device init*/
/* Initialize the display buffer */
static lv_disp_buf_t disp_buf;
static lv_color_t buf1_1[LV_HOR_RES_MAX * 10]; /*A buffer for 10 rows*/
lv_disp_buf_init(&disp_buf, buf1_1, NULL, LV_HOR_RES_MAX * 10);
/*Initialize the for display driver*/
disp_drv.buffer = &disp_buf;
disp_drv.flush_cb = fbdev_flush;
disp = lv_disp_drv_register(&disp_drv);
lv_obj_t * scr = lv_disp_get_scr_act(NULL);
lv_theme_t * th = lv_theme_mono_init(210, NULL);
/* Set the mono system theme */
Is this LCD initialization correct ?
LCD support RGB color format how to check my driver is sending colors in that format or not ? Do i need to give any printf statement in my fbdev_flush function or where . ?
Please suggest .?
You mentioned that you are using ST7789 but the example code shows
fbdev (frame buffer device used on Linux based systems). It’s strange.
I suggest trying to make you display work without LVGL first. Try to paint the whole screen red and blue and green. If it’s not working we can’t help with the integration of LVGL.
You should find a suitable driver, read the datasheet of the controller, and try to make it work. Although we have drivers to some development boards, but writing drivers is the users’ task as there are so many custom cases and settings.