Set Mappings in FieldOptions of Backend Datasource Plugin

I’m developing a backend datasource plugin. I’m trying to set the Mappings of the FieldOptions class, but I’m getting some sort of failure every time. And because I don’t have a convenient way of debugging the error, I simply don’t know what the problem is.

It happens when assigning a ValueMappingResult to the ValueMapper.

Example below…

var vm data.ValueMapper

var rx ValueMappingResult
rx.Text = "Hello"
rx.Color = "#999999"
rx.Index = 0
vm["0"] = rx  //This is where the failure will happen.

Is there a trick to this? Am I perhaps setting an invalid color?