public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var colorName = (string)value; var colorCode = SharedState.GetColor(colorName); return(colorCode); }