hexToColor static method
Get color from the hex value
Implementation
static Color hexToColor(String code) {
final buffer = StringBuffer();
if (code.length == 6 || code.length == 7) buffer.write('ff');
buffer.write(code.replaceFirst('#', ''));
return Color(int.parse(buffer.toString(), radix: 16));
}