What MCU/Processor/Board and compiler are you using?
codeblock
What do you want to achieve?
change the color of a label
What have you tried so far?
changed the code as the demo do, can’t pass compile, it says “expected expression before ‘uint16_t’”
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be between ```c and ``` tags:
First of all, it looks like you are trying to use a C++ cast in a C project. In C you would write it as (uint16_t)0x07e0. That’s why you are getting the error.
Second, colors in LittlevGL are lv_color_t values, not integers. You should use the lv_color_make function and pass it 3 RGB values, or (only if you know that LV_COLOR_DEPTH is 16) I think putting a uint16_t value in main_color.full might work.