parseColor function
Implementation
Color parseColor(String? s, {Color defaultColor = Colors.deepOrange}) {
if (s == null || s.isEmpty) return defaultColor;
String t = s;
if (s.startsWith('#')) {
t = s.substring(1);
}
if (t.length == 6) {
t = 'ff$t';
}
return Color(int.parse(t, radix: 16));
}