Have this function take `result` as it's last parameter and do something like
```
if(!defined(result)) {
  return new Color(red, green, blue, alpha)
}
result.red = red;
result.green  = freen;
result.blue= blue;
result.alpha = alpha;
return result;
```
```