toRGB method change