I'm using Javascript and Canvas to make a painting app and was using strings in this format to designate chosen colors:
rgb(255,0,0)
Because the canvas context fillStyle property takes in strings of that format.
However, I now need to obtain individual components from this string and was wondering if there was a way to do it without messy string manipulation. Possibly some built in way to convert that string to a sort of color object and then access its r, g, and b components?
Thanks.