Maximize the brightness of this CRGB object.
This makes the individual color channels as bright as possible while keeping the same value differences between channels.
- Note
- This does not keep the same ratios between channels, just the same difference in absolute values.
Definition at line 392 of file crgb.h.
392 {
393 uint8_t max = red;
394 if( green > max) max = green;
395 if( blue > max) max = blue;
396
397
398 if(max > 0) {
399 uint16_t factor = ((uint16_t)(limit) * 256) / max;
400 red = (red * factor) / 256;
401 green = (green * factor) / 256;
402 blue = (blue * factor) / 256;
403 }
404 }
References FASTLED_FORCE_INLINE.