Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.
Mammad900 edited this page Aug 29, 2020 · 1 revision

dim(color)

Summary

Dims an RGB565 color

Parameters

  1. color (uint16_t) : The color to dim

Returns

A new color with half r,g,b values.

Examples

dim(TFT_GREEN) // Returns dark green

Source

uint16_t dim(uint16_t color){ 
      int R = ((color & 0xF800) >> 9);  // Get half of Red
      int G = ((color & 0x7E0) >> 4);   // Get half of green
      int B = ((color & 0x1F) << 2);    // Get half of blue
      return tft.color565(R, G, B); //Re-assemble the color
}
Clone this wiki locally