toRGB method implemented