1 | initial version |
The reason is most likely that tmp and rgb are pointing to the same object, although I maybe shouldnt say pointing in java. So in the end its the same object and this object gets edited. You should maybe copy rgb to tmp.
tmp = rgb.clone() (hope this is also correct in java)