Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

hex color flutter

class HexColor extends Color {
  static int _getColorFromHex(String hexColor) {
    hexColor = hexColor.toUpperCase().replaceAll("#", "");
    if (hexColor.length == 6) {
      hexColor = "FF" + hexColor;
    }
    return int.parse(hexColor, radix: 16);
  }

  HexColor(final String hexColor) : super(_getColorFromHex(hexColor));
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #hex #color #flutter
ADD COMMENT
Topic
Name
6+2 =