bring back lost function ColorFromPaletteWLED (WLEDMM_SAVE_FLASH only)

this change was somehow lost - ColorFromPaletteWLED existed in colorTools.hpp (for fast inline) but was missing in colors.cpp (WLEDMM_SAVE_FLASH fallback).
This commit is contained in:
Frank
2025-11-01 14:16:47 +01:00
parent 96bfd56d20
commit 297a2c2b9c
2 changed files with 41 additions and 0 deletions

View File

@@ -51,9 +51,16 @@ bool getJsonValue(const JsonVariant& element, DestType& destination, const Defau
//colors.cpp
#if !defined(ARDUINO_ARCH_ESP32) || !defined(WLEDMM_FASTPATH) || defined(WLEDMM_SAVE_FLASH) // WLEDMM: color utils moved into colorTools.hpp, so the compiler may inline these functions (faster)
#if !defined(FASTLED_VERSION) // pull in FastLED if we don't have it yet (we need the CRGB type)
#define FASTLED_INTERNAL
#include <FastLED.h>
#endif
uint32_t __attribute__((const)) color_blend(uint32_t,uint32_t,uint_fast16_t,bool b16=false); // WLEDMM: added attribute const
uint32_t __attribute__((const)) color_add(uint32_t,uint32_t, bool fast=false); // WLEDMM: added attribute const
uint32_t __attribute__((const)) color_fade(uint32_t c1, uint8_t amount, bool video=false);
#undef ColorFromPalette // overwrite any existing override
CRGB __attribute__((hot,const)) ColorFromPaletteWLED(const CRGBPalette16& pal, unsigned index, uint8_t brightness=255, TBlendType blendType=LINEARBLEND);
#define ColorFromPalette ColorFromPaletteWLED // override fastled function
#else
#include "colorTools.hpp"
#endif