toHex method
Returns the color in Hexadecimal string format (e.g., #FF6200EE).
includeHash : Whether to prepend '#' to the result.
Implementation
String toHex({bool includeHash = true}) {
final String hex = toARGB32()
.toRadixString(16)
.padLeft(8, '0')
.toUpperCase();
return includeHash ? '#$hex' : hex;
}