colorFromHex function
e.g. #BB1122 -> FFBB1122
Implementation
String colorFromHex(String hexColor) {
hexColor = hexColor.toUpperCase().replaceFirst('#', '');
if (hexColor.length == 6) {
hexColor = 'FF$hexColor';
}
return '0x$hexColor';
}