toHex method
Convert color to hex
Implementation
String toHex(
Color color, {
bool includeHashSign = false,
bool enableAlpha = true,
bool toUpperCase = true,
}) {
final String hex =
(includeHashSign ? '#' : '') +
(enableAlpha ? _radix(color.alpha) : '') +
_radix(color.red) +
_radix(color.green) +
_radix(color.blue);
return toUpperCase ? hex.toUpperCase() : hex;
}