post-merge

* add missing "cool" option in twinklefox
* upstream compatibility defines for gamma32inv() and gamma8inv()
This commit is contained in:
Frank
2025-12-16 01:11:40 +01:00
parent 1e57262171
commit 462e4cb805
2 changed files with 8 additions and 11 deletions

View File

@@ -2768,13 +2768,7 @@ static const char _data_FX_MODE_RIPPLE_RAINBOW[] PROGMEM = "Ripple Rainbow@!,Wav
//
// TwinkleFOX: Twinkling 'holiday' lights that fade in and out.
// Colors are chosen from a palette. Read more about this effect using the link above!
// If COOL_LIKE_INCANDESCENT is set to 1, colors will
// fade out slighted 'reddened', similar to how
// incandescent bulbs change color as they get dim down.
#define COOL_LIKE_INCANDESCENT 1
CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
static CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
{
// Overall twinkle speed (changed)
uint16_t ticks = ms / SEGENV.aux0;
@@ -2814,7 +2808,7 @@ CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
CRGB c;
if (bright > 0) {
c = ColorFromPalette(SEGPALETTE, hue, bright, NOBLEND);
if(COOL_LIKE_INCANDESCENT == 1) {
if (!SEGMENT.check1) {
// This code takes a pixel, and if its in the 'fading down'
// part of the cycle, it adjusts the color a little bit like the
// way that incandescent bulbs fade toward 'red' as they dim.
@@ -2836,7 +2830,7 @@ CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
// "CalculateOneTwinkle" on each pixel. It then displays
// either the twinkle color of the background color,
// whichever is brighter.
uint16_t twinklefox_base(bool cat)
static uint16_t twinklefox_base(bool cat)
{
// "PRNG16" is the pseudorandom number generator
// It MUST be reset to the same starting value each time
@@ -2889,7 +2883,7 @@ uint16_t twinklefox_base(bool cat)
} else {
// if the new pixel is not at all brighter than the background color,
// just use the background color.
SEGMENT.setPixelColor(i, bg.r, bg.g, bg.b);
SEGMENT.setPixelColor(i, bg);
}
}
return FRAMETIME;
@@ -2900,7 +2894,7 @@ uint16_t mode_twinklefox()
{
return twinklefox_base(false);
}
static const char _data_FX_MODE_TWINKLEFOX[] PROGMEM = "Twinklefox@!,Twinkle rate;!,!;!";
static const char _data_FX_MODE_TWINKLEFOX[] PROGMEM = "Twinklefox@!,Twinkle rate,,,,Cool;!,!;!";
uint16_t mode_twinklecat()