2.2" 18-bit color TFT LCD
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- normlane
- Posts: 128
- Joined: Thu Apr 01, 2010 5:39 pm
2.2" 18-bit color TFT LCD
I'm finding 18 bit color a little confusing. Is there a utility somewhere to help find values for various colors?
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: 2.2" 18-bit color TFT LCD
Just did some googling. There are nice 24-bit color calculators out there, but I found nothing for 18-bit color.
What is it you're having trouble with?
What is it you're having trouble with?
- normlane
- Posts: 128
- Joined: Thu Apr 01, 2010 5:39 pm
Re: 2.2" 18-bit color TFT LCD
Well, this display uses 6 bit colors rather than the usual 8 bits. Now values for rgb should add up to 18 bits, right? Except that the colors in the examples add up to 16 bits, two bytes. So what's the algorithm to convert back & forth?
- normlane
- Posts: 128
- Joined: Thu Apr 01, 2010 5:39 pm
Re: 2.2" 18-bit color TFT LCD
I realize that data is discarded and I end up with 65,535 possible colors instead of 16,777,215. Or is this display actually 5 bit color? in which case White wouldn't be 0xffff.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: 2.2" 18-bit color TFT LCD
16-bit color is 5-6-5: 5 bits of R, 6 bits of G, and 5 bits of B. If I'm not mistaken, the driver left-shifts the R and B to make 6 bits when you give it 16-bit data. It really is an 18-bit display.
- normlane
- Posts: 128
- Joined: Thu Apr 01, 2010 5:39 pm
Re: 2.2" 18-bit color TFT LCD
Ok thanks. I think I can do something with that info. You saved me a lot of hassle. My guesses on how this worked were a tad off the mark.
Please be positive and constructive with your questions and comments.