chartColor function
Parses a hex color like #FF4A3D; null when it isn't one.
Implementation
Color? chartColor(Object? value) {
if (value is! String || value.isEmpty) return null;
try {
return ColorRGBA.fromJson(value).toFlutterColor();
} catch (_) {
return null;
}
}