ColorParser.hex constructor

ColorParser.hex(
  1. String hexCode
)

get the object of this class using hex color code

Implementation

ColorParser.hex(String hexCode) {
  bool startsWithHash = hexCode.startsWith("#");
  this._color = new Color(int.parse(
          hexCode.substring(startsWithHash ? 1 : 0, startsWithHash ? 7 : 6),
          radix: 16) +
      0xFF000000);
  _calculateFromRGB();
}