diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp old mode 100755 new mode 100644 index 14364bc0..72eb6ac0 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -1085,27 +1085,14 @@ void Segment::blur(uint8_t blur_amount, bool smear) const { /* * Put a value 0 to 255 in to get a color value. * The colours are a transition r -> g -> b -> back to r - * Inspired by the Adafruit examples. + * Rotates the color in HSV space, where pos is H. (0=0deg, 256=360deg) */ uint32_t Segment::color_wheel(uint8_t pos) const { - if (palette) return color_from_palette(pos, false, false, 0); // never wrap palette + if (palette) return color_from_palette(pos, false, false, 0); // only wrap if "always wrap" is set uint8_t w = W(getCurrentColor(0)); - pos = 255 - pos; - if (useRainbowWheel) { - CRGB rgb; - hsv2rgb_rainbow(CHSV(pos, 255, 255), rgb); - return RGBW32(rgb.r, rgb.g, rgb.b, w); - } else { - if (pos < 85) { - return RGBW32((255 - pos * 3), 0, (pos * 3), w); - } else if (pos < 170) { - pos -= 85; - return RGBW32(0, (pos * 3), (255 - pos * 3), w); - } else { - pos -= 170; - return RGBW32((pos * 3), (255 - pos * 3), 0, w); - } - } + uint32_t rgb; + hsv2rgb(CHSV32(static_cast(pos << 8), 255, 255), rgb); + return rgb | (w << 24); // add white channel } /* diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index 8424b6ba..d3882da4 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -519,7 +519,6 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { CJSON(briMultiplier, light[F("scale-bri")]); CJSON(paletteBlend, light[F("pal-mode")]); CJSON(strip.autoSegments, light[F("aseg")]); - CJSON(useRainbowWheel, light[F("rw")]); CJSON(gammaCorrectVal, light["gc"]["val"]); // default 2.2 float light_gc_bri = light["gc"]["bri"]; @@ -1042,7 +1041,6 @@ void serializeConfig(JsonObject root) { light[F("scale-bri")] = briMultiplier; light[F("pal-mode")] = paletteBlend; light[F("aseg")] = strip.autoSegments; - light[F("rw")] = useRainbowWheel; JsonObject light_gc = light.createNestedObject("gc"); light_gc["bri"] = (gammaCorrectBri) ? gammaCorrectVal : 1.0f; // keep compatibility diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index c01db311..928da117 100644 --- a/wled00/data/settings_leds.htm +++ b/wled00/data/settings_leds.htm @@ -908,7 +908,6 @@ Swap:
Use harmonic Random Cycle palette:
- Use "rainbow" color wheel:
Target refresh rate: FPS diff --git a/wled00/set.cpp b/wled00/set.cpp index 0ae6fe89..9d794679 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -351,7 +351,6 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) t = request->arg(F("TP")).toInt(); randomPaletteChangeTime = MIN(255,MAX(1,t)); useHarmonicRandomPalette = request->hasArg(F("TH")); - useRainbowWheel = request->hasArg(F("RW")); nightlightTargetBri = request->arg(F("TB")).toInt(); t = request->arg(F("TL")).toInt(); diff --git a/wled00/wled.h b/wled00/wled.h index 3772fcd1..8ec66559 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -625,7 +625,6 @@ WLED_GLOBAL unsigned long transitionStartTime; WLED_GLOBAL bool jsonTransitionOnce _INIT(false); // flag to override transitionDelay (playlist, JSON API: "live" & "seg":{"i"} & "tt") WLED_GLOBAL uint8_t randomPaletteChangeTime _INIT(5); // amount of time [s] between random palette changes (min: 1s, max: 255s) WLED_GLOBAL bool useHarmonicRandomPalette _INIT(true); // use *harmonic* random palette generation (nicer looking) or truly random -WLED_GLOBAL bool useRainbowWheel _INIT(false); // use "rainbow" color wheel instead of "spectrum" color wheel // nightlight WLED_GLOBAL bool nightlightActive _INIT(false); diff --git a/wled00/xml.cpp b/wled00/xml.cpp index 987167d7..d6f2bf2d 100644 --- a/wled00/xml.cpp +++ b/wled00/xml.cpp @@ -382,7 +382,6 @@ void getSettingsJS(byte subPage, Print& settingsScript) printSetFormValue(settingsScript,PSTR("TL"),nightlightDelayMinsDefault); printSetFormValue(settingsScript,PSTR("TW"),nightlightMode); printSetFormIndex(settingsScript,PSTR("PB"),paletteBlend); - printSetFormCheckbox(settingsScript,PSTR("RW"),useRainbowWheel); printSetFormValue(settingsScript,PSTR("RL"),rlyPin); printSetFormCheckbox(settingsScript,PSTR("RM"),rlyMde); printSetFormCheckbox(settingsScript,PSTR("RO"),rlyOpenDrain);