split_rgb is currently a global variable - change it to a local variable by putting var in front of it;