16 uint16_t target = value * 257;
22 return (target - a <=
b - target) ? lo : lo + 1;
28 this->color_uncorrect_blue(color.
blue), this->color_uncorrect_white(color.
white));
38 return static_cast<uint8_t
>(std::min(res,
uint32_t(255)));
uint8_t gamma_correct_(uint8_t value) const
Forward gamma: read uint16 PROGMEM table, convert to uint8.
uint8_t color_uncorrect_red(uint8_t red) const ESPHOME_ALWAYS_INLINE
uint8_t color_uncorrect_channel_(uint8_t value, uint8_t max_brightness) const
Shared body of color_uncorrect_{red,green,blue,white}.
Color color_uncorrect(Color color) const
const uint16_t * gamma_table_
uint8_t gamma_uncorrect_(uint8_t value) const
Reverse gamma: binary search the forward PROGMEM table.
uint8_t local_brightness_
uint8_t gamma_table_reverse_search(const uint16_t *table, uint16_t target)
Binary search a monotonically increasing uint16[256] PROGMEM table.
uint16_t progmem_read_uint16(const uint16_t *addr)