Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions wled00/FX_fcn.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -1076,27 +1076,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<uint16_t>(pos << 8), 255, 255), rgb);
return rgb | (w << 24); // add white channel
}

/*
Expand Down
2 changes: 0 additions & 2 deletions wled00/cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,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"];
Expand Down Expand Up @@ -1040,7 +1039,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
Expand Down
1 change: 0 additions & 1 deletion wled00/data/settings_leds.htm
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,6 @@ <h3>Advanced</h3>
<option value="3">None (not recommended)</option>
</select><br>
Use harmonic <i>Random Cycle</i> palette: <input type="checkbox" name="TH"><br>
Use &quot;rainbow&quot; color wheel: <input type="checkbox" name="RW"><br>
Target refresh rate: <input type="number" class="s" min="0" max="250" name="FR" oninput="UI()" required> FPS
<div id="fpsNone" class="warn" style="display: none;">&#9888; Unlimited FPS Mode is experimental &#9888;<br></div>
<div id="fpsHigh" class="warn" style="display: none;">&#9888; High FPS Mode is experimental.<br></div>
Expand Down
1 change: 0 additions & 1 deletion wled00/set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,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();
Expand Down
1 change: 0 additions & 1 deletion wled00/wled.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,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);
Expand Down
1 change: 0 additions & 1 deletion wled00/xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,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);
Expand Down