Go Down

Topic: Arduino HEX(ie. 0xFB00) color chart (Read 14522 times) previous topic - next topic

klemko

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.

PaulS

Quote
Any idea how i could get codes for the rest of colors?
Post a link to the library. The format is probably 5 bits for red, 6 bits for blue, and 5 bits for green.
The art of getting good answers lies in asking good questions.

klemko

https://learn.adafruit.com/downloads/pdf/adafruit-gfx-graphics-library.pdf

Yes it works (5-6-5) like this, but how can i get color codes from that?

arduinodlb

#3
Jan 04, 2016, 02:49 pm Last Edit: Jan 04, 2016, 02:54 pm by arduinodlb
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.

http://www.barth-dev.de/online/rgb565-color-picker/
Do not IM me. I will not respond. Ask questions in the forum.

AWOL

#4
Jan 04, 2016, 02:50 pm Last Edit: Jan 04, 2016, 02:51 pm by AWOL
Code: [Select]
#define BLUE 0x001F
 suggests five bits for blue
Code: [Select]
#define RED 0xF800
 five for red
Code: [Select]
#define GREEN 0x07E0
 six for green

(The human eye is most sensitive to green, so having twice as many shades of green available makes sense)

PaulS

Quote
but how can i get color codes from that?
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.
The art of getting good answers lies in asking good questions.

aarg

Adafruit products usually have pretty good documentation. You're just looking in the wrong place.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

klemko

thanks you all for help and thanks @arduinodlb for solution. :DD

KimPlayz4LK

Please, is anyone can tell me about what is the orange color code?

Deva_Rishi

Please, is anyone can tell me about what is the orange color code?
Orange is red with a bit of green..
To 'Correct' you have to be Correct. (and not be condescending..)

larryd

For orange, make a sketch with a for loop that can be controlled with a switch.

Have the colours sent to LEDs, when you get to the colour desired, push switch to print the current colour value.



No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

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.

Deva_Rishi

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
To 'Correct' you have to be Correct. (and not be condescending..)

Go Up