hexColor function
Implementation
Color hexColor(String hexColor) {
try {
hexColor = hexColor.toUpperCase().replaceAll('#', '');
if (hexColor.length == 6) {
hexColor = 'FF$hexColor';
}
return Color(int.parse(hexColor, radix: 16));
} catch (ex) {
return Colors.white;
}
}