convertToColor function
Implementation
Color convertToColor(String color) {
if (color.runtimeType == String) {
return Color(getColorCode(color.toString()));
}
final colorInt = toInt(color);
if (colorInt == null) {
return Colors.black;
}
return Color(colorInt);
}