The API's do not use the routine I use to parse a single string with colornames to a array of numbers (with the right counts accoding to the image and channel setting).
Originally the routine that does this was in the 'core' library so that it would be available for parsing a 'single string argument' but this was then moved into the command parser and made static to that module only. This was not my doing, and I has misgivings about that specific move.
As a consequence you have to specify each of the color as purely an array of numbers, without the colorname conversion
what numbers (floating point) are needed for each color depends on the intersection of the 'channel' setting and the channels present in the image. Whcih as you can immagine can be a little tricky to handle.
It is posible the API you are using could be set up to handle an array such as you have specified, but currently that is not the case.