eez-open / studio

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

Style exports with wrong color format #656

Open lsroka76 opened 23 hours ago

lsroka76 commented 23 hours ago

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

mvladic commented 23 hours ago

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

lsroka76 commented 12 hours 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 12 hours 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.