its your lcd code. if it displays a 3 digit number ie. 250. then it displays a 2 digit number ie. 50. it will show as 500 since it didn’t clear out the previous printed digit in that position. with the code you have you need to print fixed length numbers otherwise you will get visual glitches like this.
if you look at the code you will see it finds the max of all 3 channels, then divides each channel by the max which will always be 0-1 and that is multiplied by 255 so it shouldn’t be possible for the value to actually go bigger.