Calculates the combined color adjustment to the LEDs at a given scale, color correction, and color temperature.
- Parameters
-
scale | the scale value for the RGB data (i.e. brightness) |
colorCorrection | color correction to apply |
colorTemperature | color temperature to apply |
- Returns
- a CRGB object representing the adjustment, including color correction and color temperature
Definition at line 29 of file crgb.cpp.
30 {
31#if defined(NO_CORRECTION) && (NO_CORRECTION == 1)
33#else
36 for (uint8_t i = 0; i < 3; ++i) {
37 uint8_t cc = colorCorrection.raw[i];
38 uint8_t ct = colorTemperature.raw[i];
39 if (cc > 0 && ct > 0) {
40
41
42 uint32_t work = (((uint16_t)cc) + 1);
43 work *= (((uint16_t)ct) + 1);
45 work /= 0x10000L;
46 adj.raw[i] = work & 0xFF;
47 }
48 }
49 }
50 return adj;
51#endif
52}
FASTLED_FORCE_INLINE CRGB()=default
Default constructor.
References CRGB(), and scale.
Referenced by CLEDController::getAdjustment().