Customizing NeoPixel Compatible LED Ring (WS2812) colors and brightness using ILI9341 2.8" Touch Screen Lcd, the color is modulated using RGB 24 bit values.
Later in the code, the conversion from RGB 24 bits to RGB 16 bits is due to a method (fillRoudRect) that accepts only uint16_t colors as arguments, we use this function to represent the resulting color on screen from different r g b values selected
Detect which bar is clicked (brightness, red, blue green)
light the neo pixel lamp using the RGB values picked on screen
transfer a color represented in decimal to binary and save it in an array passed as an argument - in our case, the array is a global variable-
return decimal representation (uint16_t) of a color represented in binary (array of 16 bits)
draw the brightness bar
on screen touch, reads the brightness value entered by user
change brightness bar width to match brightness value
draw the red bar
on screen touch, reads the red color value entered by user
change red bar width to match red color value
draw the green bar
on screen touch, reads the green color value entered by user
change red bar width to match green color value
draw the blue bar
on screen touch, reads the blue color value entered by user
change red bar width to match blue color value
draw the rectangle that displays the current choosed color
on modifying r g b values update the color displayed on screen
populate the screen (r g b brightness bars + color)