Skip to content

Commit 078400e

Browse files
Fix color calculation in gridAddPixel for dynamic color shifting
1 parent 468c5ce commit 078400e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ledmatrix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void LEDMatrix::setMinIndicator(uint8_t pattern, uint32_t color)
138138
void LEDMatrix::gridAddPixel(uint8_t x, uint8_t y, uint32_t color)
139139
{
140140
if(dynamicColorShiftActivePhase >= 0){
141-
color = Wheel((uint16_t(x + y) * 256 * 2 / (WIDTH*HEIGHT) + dynamicColorShiftActivePhase) % 256);
141+
color = Wheel((uint16_t(x + y*WIDTH) * 256 * 2 / (WIDTH*HEIGHT) + dynamicColorShiftActivePhase) % 256);
142142
}
143143
// limit ranges of x and y
144144
if(x < WIDTH && y < HEIGHT){

0 commit comments

Comments
 (0)