toHex method
Returns the hex string representation of this color
Implementation
String toHex({bool withAlpha = true, bool includeHashSign = true}) {
String prefix = includeHashSign ? '#' : '';
if (withAlpha) {
return '$prefix${value.toRadixString(16).padLeft(8, '0').toUpperCase()}';
} else {
return '$prefix${value.toRadixString(16).padLeft(8, '0').substring(2).toUpperCase()}';
}
}