eez-open / studio

Cross-platform low-code GUI and automation
https://www.envox.eu/studio/studio-introduction/
GNU General Public License v3.0
641 stars 102 forks source link

Style exports with wrong color format #656

Open lsroka76 opened 4 days ago

lsroka76 commented 4 days ago

When I create Style and define some colors for it they are exported in wrong format in styles.c.

mvladic commented 4 days ago

Can you give me some example, i.e. what did you expect and what did you get?

lsroka76 commented 4 days ago

I use "Add Style", name it like "test_style", select for "Button" and then select colors for background and gradient using Color Picker. When I check hex values for colors in EEZ Studio everything is OK but after export project to C files in styles.c there are "lv_color_hex(0xffxxxxxx)" - it looks like color is exported with alpha mask? Also RGB order looks misplaced?

I use LVGL 8.3.

mvladic commented 4 days ago

... it looks like color is exported with alpha mask?

Yes, but it is ignored by the lv_color_hex function. Maybe we should omit alpha mask so instead of 0xffrrggbb just export 0xrrggbb to prevent any confusion.

Also RGB order looks misplaced?

It is not misplaced. Function lv_color_hex expects argument in the format 0x??rrggbb (where ?? is ignored) which is exactly what is generated.

lsroka76 commented 17 hours ago

My fault - data lines for R and B were switched.