colorFromJson static method
Implementation
static Color colorFromJson(String colorString) {
if (colorString == 'transparent') {
return Colors.transparent;
}
int? intColor = int.tryParse(colorString, radix: 16);
if (intColor == null) {
return Colors.black;
} else {
return Color(intColor);
}
}