That's not quite correct... The previous code was doing a type conversion to string (which is what ep.copyasstringref() does), and also only setting the value if the key existed and was not empty. To do this use some auxillary methods. i.e. in this case, we need a utility:
```
static bool copy_element_as_color_if_non_empty(MCExecContext& ctxt, MCArrayRef array, MCNameRef key, MCColor& r_value)
{
  MCValueRef t_value;
  if (!MCArrayFetchValue(array, false, key, t_value))
    return false;
  if (MCValueIsEmpty(t_value))
    return false;
  MCAutoStringRef t_string;
  if (!ctxt . ConvertToString(t_value, &t_string))
    return false;
 return MCscreen -> parsecolor(*t_string, r_value, nil);
}
```
Then the code becomes (we bracket it in { } to keep the scope of the value we fetch limited):
```
{
  MCColor t_color;
  if (copy_element_as_color_if_non_empty(ctxt, p_style, MCNAME("backgroundColor"), &t_color))
    t_block -> setbackcolor(&t_color);
}
```