Move blendPixelColor() to FX_fcn.cpp

This commit is contained in:
cschwinne 2020-08-30 10:57:42 +02:00
parent aee9c4a193
commit 20f6378a3e
2 changed files with 16 additions and 15 deletions

View File

@ -3565,6 +3565,7 @@ uint16_t WS2812FX::mode_chunchun(void)
return FRAMETIME; return FRAMETIME;
} }
typedef struct Spotlight { typedef struct Spotlight {
float speed; float speed;
uint8_t colorIdx; uint8_t colorIdx;
@ -3574,21 +3575,13 @@ typedef struct Spotlight {
uint8_t type; uint8_t type;
} spotlight; } spotlight;
static const uint8_t SPOT_TYPE_SOLID = 0; #define SPOT_TYPE_SOLID 0
static const uint8_t SPOT_TYPE_GRADIENT = 1; #define SPOT_TYPE_GRADIENT 1
static const uint8_t SPOT_TYPE_2X_GRADIENT = 2; #define SPOT_TYPE_2X_GRADIENT 2
static const uint8_t SPOT_TYPE_2X_DOT = 3; #define SPOT_TYPE_2X_DOT 3
static const uint8_t SPOT_TYPE_3X_DOT = 4; #define SPOT_TYPE_3X_DOT 4
static const uint8_t SPOT_TYPE_4X_DOT = 5; #define SPOT_TYPE_4X_DOT 5
static const uint8_t SPOT_TYPES_COUNT = 6; #define SPOT_TYPES_COUNT 6
/*
* Blends the specified color with the existing pixel color.
*/
void WS2812FX::blendPixelColor(uint16_t n, uint32_t color, uint8_t blend)
{
setPixelColor(n, color_blend(getPixelColor(n), color, blend));
}
/* /*
* Spotlights moving back and forth that cast dancing shadows. * Spotlights moving back and forth that cast dancing shadows.

View File

@ -597,6 +597,14 @@ void WS2812FX::fill(uint32_t c) {
} }
} }
/*
* Blends the specified color with the existing pixel color.
*/
void WS2812FX::blendPixelColor(uint16_t n, uint32_t color, uint8_t blend)
{
setPixelColor(n, color_blend(getPixelColor(n), color, blend));
}
/* /*
* fade out function, higher rate = quicker fade * fade out function, higher rate = quicker fade
*/ */