forked from Makuna/NeoPixelBus
SwapPixelColor (#221)
This commit is contained in:
@@ -105,6 +105,7 @@ PixelsSize KEYWORD2
|
||||
PixelCount KEYWORD2
|
||||
SetPixelColor KEYWORD2
|
||||
GetPixelColor KEYWORD2
|
||||
SwapPixelColor KEYWORD2
|
||||
CalculateBrightness KEYWORD2
|
||||
Darken KEYWORD2
|
||||
Lighten KEYWORD2
|
||||
|
@@ -322,7 +322,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void SwapPixelColor(uint16_t indexPixelOne, uint16_t indexPixelTwo)
|
||||
{
|
||||
auto colorOne = GetPixelColor(indexPixelOne);
|
||||
auto colorTwo = GetPixelColor(indexPixelTwo);
|
||||
|
||||
SetPixelColor(indexPixelOne, colorTwo);
|
||||
SetPixelColor(indexPixelTwo, colorOne);
|
||||
};
|
||||
|
||||
protected:
|
||||
const uint16_t _countPixels; // Number of RGB LEDs in strip
|
||||
|
Reference in New Issue
Block a user