toHex method
Prefixes a hash sign if leadingHashSign is set to true and returns the hexadecimal string value of the color.
Implementation
String toHex({bool leadingHashSign = true}) => '${leadingHashSign ? '#' : ''}'
'${a.round().toRadixString(16).padLeft(2, '0')}'
'${r.round().toRadixString(16).padLeft(2, '0')}'
'${g.round().toRadixString(16).padLeft(2, '0')}'
'${b.round().toRadixString(16).padLeft(2, '0')}';