Skip to content

Commit 1eb1f5f

Browse files
committed
Bugfix in Fire 2012
1 parent 148e3e9 commit 1eb1f5f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

wled00/FX.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,9 +1927,8 @@ uint16_t mode_fire_2012() {
19271927

19281928
// Step 4. Map from heat cells to LED colors
19291929
for (unsigned j = 0; j < SEGLEN; j++) {
1930-
// prevent use of blend region (241-255) from palette by limiting heat to 240 (not all palettes have a smooth blend region, though)
1931-
//CRGBA color = ColorFromPaletteWLED(SEGPALETTE, heat[j], 255, LINEARBLEND_NOWRAP);
1932-
CRGBA color = SEGMENT.color_from_palette(MIN(heat[j],240), false, false, 0);
1930+
// prevent use of blend region (241-255) from palette by LINEARBLEND_NOWRAP
1931+
CRGBA color = ColorFromPaletteWLED(SEGPALETTE, heat[j], 255, LINEARBLEND_NOWRAP);
19331932
SEGMENT.setPixelColor(indexToVStrip(j, stripNr), color);
19341933
}
19351934
}

wled00/colors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ uint32_t color_fade(uint32_t c1, uint8_t amount, bool video) {
128128
// If you do not want any blending at all, use NOBLEND which effectively reduces color entries count to 16.
129129
CRGBA ColorFromPaletteWLED(const CRGBPalette16& pal, uint8_t index, uint8_t brightness, TBlendType blendType) {
130130
if (blendType == LINEARBLEND_NOWRAP) {
131-
index = (index*240) >> 8; // Blend range is affected by lo4 blend of values, remap to avoid wrapping
131+
index = (index*241) >> 8; // Blend range is affected by lo4 blend of values, remap to avoid wrapping
132132
}
133133
unsigned hi4 = (index & 0xF0) >> 4;
134134
unsigned lo4 = (index & 0x0F);

0 commit comments

Comments
 (0)