That's great.
I would suggest to trim the string and retrieve the first parameter using the position of the first space with Pos, so that a command line would look like:
Rectangle 10,10,90,90,"rgba(100,100,100,100)","rgb(100,0,100,100)"
when checking for the function name, you can LowerCase function so that case is ignored.