I am using a color tft screen and so far i was using only bitmaps. But now i want to draw some shapes myself(mainly to speed up display process), but i am really confused about color codes.
It is not a standard HEX format(6 letters) but it has 4 letters, for example 0xFFE0(yellow). I searched over all color charts(bmp, hex, rgb,...) a ton of convertes and color calculators but i could not find any that would make a correct code.
This is color codes i got along whit library(Adafruit GFX): #define BLACK 0x0000 #define BLUE 0x001F #define RED 0xF800 #define GREEN 0x07E0 #define CYAN 0x07FF #define MAGENTA 0xF81F #define YELLOW 0xFFE0 #define WHITE 0xFFFF
Any idea how i could get codes for the rest of colors? Thanks.
The format is called RGB565. It is similar to RGB888, but only uses 16 bits (5+6+5) instead of 24 (8+8+8) and so has less fine control over the colours (less colours available overall).
Here's a website to help calculate RGB565 values, but you should try to understand the format because it is not terribly difficult.
The red value can be anything from 0 to 31. The green value can be anything from 0 to 63. The blue value can be anything from 0 to 21. Using <<, you can shift the red value 11 bits, then add the green value, after shifting it 5 bits, then add the blue value.
I have always found that orange is a very difficult colour to make with RGB LEDs. A lot depends on the diffuser you use and the background colour it is viewed against. Mind you brown is a lot harder to get.
Grumpy_Mike:
I have always found that orange is a very difficult colour to make with RGB LEDs. A lot depends on the diffuser you use and the background colour it is viewed against. Mind you brown is a lot harder to get.
Brown is easy on a 12v ws2811, just power it with 8v