fromHex static method
Converts the Color object to a hexadecimal string representation.
The output can be customized to include or exclude the leading '#' symbol and the alpha (transparency) value.
String is in the format "aabbcc" or "ffaabbcc" with an optional leading "#".
Implementation
static Color fromHex(String hexString) {
final buffer = StringBuffer();
if (hexString.length == 6 || hexString.length == 7) buffer.write('ff');
buffer.write(hexString.replaceFirst('#', ''));
return Color(int.parse(buffer.toString(), radix: 16));
}