Drawing specific RGB on touch screen I have the Arduino MEGA and an adafruit touch screen 2.8 inches.

My goal is to draw a pixel given a specific RGB

I am using the ILI9341, GFX, and TFT.h libraries to draw and control the touch screen. I noticed the drawPixel function given, in which it takes in three parameters and draws the pixel:

tft.drawPixel(4,4,ILI9341_BLUE);


But, I am trying to draw a pixel with specific a RGB. So instead, the function would ideally need 5 parameters instead of 3, x, y, and then R, G, and B:

tft.idealDrawPixel(5,6,89,234,76);


I tried putting in a number as the third parameter and not ILI9341_COLOR, and the screen just prints blue:

tft.drawPixel(45,67,255);


Is there a function that allows me to draw RGB pixels specifically? Thanks for any help!
As noted in the second paragraph on Adafruit's Graphics Library webpage, 


  First thing to note is that color is 16-bit, and that includes Red, Green and Blue in a 16-bit variable. The way the color is packed in is the top 5 bits are red, the middle 6 bits are green and the bottom 5 bits are blue.


If you want to specify 8-bit color components, you could write an intermediary routine to translate from that form to the 565 form.  For example:

#define rgbDrawPixel(x,y,r,g,b) drawPixel(x,y,(((r)&amp;0b11111000)&lt;&lt;8)|(((g)&amp;0b11111100)&lt;&lt;3)|(((b)&amp;0b11111000)&gt;&gt;3))


Note, this assumes the TFT library you're using has the same specs as Adafruit's.  That might or might not be; I don't know how to account for a 255 color number showing up as blue rather than white.