diff --git a/wled00/FX.h b/wled00/FX.h index 9f045bad..3912faa9 100644 --- a/wled00/FX.h +++ b/wled00/FX.h @@ -496,6 +496,9 @@ typedef struct Segment { inline bool isSelected(void) const { return selected; } inline bool isActive(void) const { return stop > start; } inline bool is2D(void) const { return (width()>1 && height()>1); } + inline bool hasRGB(void) const { return _isRGB; } + inline bool hasWhite(void) const { return _hasW; } + inline bool isCCT(void) const { return _isCCT; } inline uint16_t width(void) const { return stop - start; } // segment width in physical pixels (length if 1D) inline uint16_t height(void) const { return stopY - startY; } // segment height (if 2D) in physical pixels inline uint16_t length(void) const { return width() * height(); } // segment length (count) in physical pixels diff --git a/wled00/json.cpp b/wled00/json.cpp index ef770143..54300035 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -125,7 +125,7 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId) JsonArray colarr = elem["col"]; if (!colarr.isNull()) { - if (seg.getLightCapabilities() & 3) { + if (seg.hasRGB() || seg.hasWhite()) { // segment has RGB or White for (size_t i = 0; i < 3; i++) { @@ -204,7 +204,7 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId) getVal(elem["ix"], &seg.intensity); uint8_t pal = seg.palette; - if (seg.getLightCapabilities() & 1) { // ignore palette for White and On/Off segments + if (seg.hasRGB()) { // ignore palette for White and On/Off segments if (getVal(elem["pal"], &pal)) seg.setPalette(pal); }