I haven't run the code, but I was driving by and I noticed this line. Which reads:
this.pixels = new Pixel[length * (3/4)]; // changing this to 3/4
3/4 in Java is an integer division expression that evaluates to zero. If you're trying to scale an integer by 3/4, removing the parentheses will get the right answer, assuming it doesn't overflow.
The corresponding logic to switch back out of RGBW seems to have the wrong multiplier, in addition to the zero bug.
I haven't run the code, but I was driving by and I noticed this line. Which reads:
3/4in Java is an integer division expression that evaluates to zero. If you're trying to scale an integer by 3/4, removing the parentheses will get the right answer, assuming it doesn't overflow.The corresponding logic to switch back out of RGBW seems to have the wrong multiplier, in addition to the zero bug.