I am working on a simple project which uses an ESP8266 to receive data from a web server from a colour picker. I have that working and all I need to do now is to send that value to a nextion display. However the nextion display only supports 16 bit colour values ranging from 0 to 65535 whilst the colour picker on my web server sends back a 24 bit RGB value ranging from 0 to 255 for each primary colour (eg, red = 255, green = 67, blue=100).
(Note: Each colour in the RGB value is 8 bits, since there are 3 the total amount is 24 bits)
Is there a way to convert the 24 bit RGB value to the 16bit colour value for the display?