toHex method
Implementation
String toHex({bool includeHashSign = false, bool includeAlpha = true}) {
String hex = value.toRadixString(16).padLeft(8, '0');
if (!includeAlpha) {
hex = hex.substring(2);
}
if (includeHashSign) {
hex = '#$hex';
}
return hex;
}