toHex method Null safety

String toHex()

Get an Hexadecimal representation of this color

Implementation

String toHex() {
  final i = toInt();
  final rgb = (i & 0xffffff).toRadixString(16);
  final a = ((i & 0xff000000) >> 24).toRadixString(16);
  return '#$rgb$a';
}