pull/3810/head
Blaz Kristan 2024-03-18 20:23:30 +01:00
rodzic 0dcb56eab5
commit 7a9eff7f35
3 zmienionych plików z 9 dodań i 6 usunięć

Wyświetl plik

@ -538,7 +538,6 @@ bool Segment::setColor(uint8_t slot, uint32_t c) { //returns true if changed
}
void Segment::setCCT(uint16_t k) {
if (!isCCT() || !correctWB) return;
if (k > 255) { //kelvin value, convert to 0-255
if (k < 1900) k = 1900;
if (k > 10091) k = 10091;

Wyświetl plik

@ -441,10 +441,19 @@ void BusPwm::setPixelColor(uint16_t pix, uint32_t c) {
_data[0] = w;
break;
case TYPE_ANALOG_2CH: //warm white + cold white
#ifdef WLED_USE_IC_CCT
_data[0] = w;
_data[1] = cct;
#else
Bus::calculateCCT(c, _data[0], _data[1]);
#endif
break;
case TYPE_ANALOG_5CH: //RGB + warm white + cold white
#ifdef WLED_USE_IC_CCT
_data[4] = cct;
#else
Bus::calculateCCT(c, w, _data[4]);
#endif
case TYPE_ANALOG_4CH: //RGBW
_data[3] = w;
case TYPE_ANALOG_3CH: //standard dumb RGB

Wyświetl plik

@ -194,10 +194,6 @@ class Bus {
cct = (approximateKelvinFromRGB(c) - 1900) >> 5;
}
#ifdef WLED_USE_IC_CCT
ww = w;
cw = cct;
#else
//0 - linear (CCT 127 = 50% warm, 50% cold), 127 - additive CCT blending (CCT 127 = 100% warm, 100% cold)
if (cct < _cctBlend) ww = 255;
else ww = ((255-cct) * 255) / (255 - _cctBlend);
@ -206,7 +202,6 @@ class Bus {
ww = (w * ww) / 255; //brightness scaling
cw = (w * cw) / 255;
#endif
}
inline void setAutoWhiteMode(uint8_t m) { if (m < 5) _autoWhiteMode = m; }
inline uint8_t getAutoWhiteMode() { return _autoWhiteMode; }