/* Adjusts the supplied color to have the specified intensity (0..100). 100 will leave the color as is at full intensity, 50 will reduce the color intensity by half, and 0 will return black. 
This function is useful for anti-aliasing and sub-pixel rendering since colors are returned as a percentage of the original value, depending on the amount of space they take up in the sub-pixel array. */
uint16_t colorsDim(uint16_t color, uint8_t intensity)
/* Adjusts the supplied color to have the specified intensity (0..100). 100 will leave the color as is at full intensity, 50 will reduce the color intensity by half, and 0 will return black. 
This function is useful for anti-aliasing and sub-pixel rendering since colors are returned as a percentage of the original value, depending on the amount of space they take up in the sub-pixel array. */
uint16_t colorsDim(uint16_t color, uint8_t intensity)
{
  uint16_t r, g, b;
  r = ((((color >> 11) & 0x1F) * intensity) / 100) & 0x1F;
  g = ((((color >> 5) & 0x3F) * intensity) / 100) & 0x3F;
  b = (((color & 0x1F)  * intensity) / 100) & 0x1F;
  return (r << 11) | (g << 6) | b;
}