toHex function
Implementation
String toHex(Color color,
{bool leadingHashSign = true, bool withAlpha = true}) =>
'${leadingHashSign ? '#' : ''}'
'${_generateAlpha(alpha: ((color.a * 255.0).round() & 0xff), withAlpha: withAlpha)}'
'${((color.r * 255.0).round() & 0xff).toRadixString(16).padLeft(2, '0').toUpperCase()}'
'${((color.g * 255.0).round() & 0xff).toRadixString(16).padLeft(2, '0').toUpperCase()}'
'${((color.b * 255.0).round() & 0xff).toRadixString(16).padLeft(2, '0').toUpperCase()}' /* .toUpperCase() */;