Like Fengist said, it's hard to guess the problem without a code to check. But, it may be that you are asigning string values instead of numbers when trying to set the colors. If each array is a string, like "123,45,98", you must, first convert those to numbers using int(value).
For instance if you have "123,45,98" as a value.
Instead of using "set color" to
rgbEx(array.At(x,y))
You must get each of those and convert to integer. Something like this
rgbEx(tokenat(array.At(x,y), 0, ","),tokenat(array.At(x,y), 2, ","),tokenat(array.At(x,y), 2, ","))
Maybe the problem has nothing to do with this, but it's a guess since I have no access to you code.
Cheers!