Flutter 中color的16进制

import 'dart:ui';

class ColorHex extends Color {

static int _getColorFromHex(String hexColor) {

hexColor = hexColor.toUpperCase().replaceAll("#", "");

if (hexColor.length == 6) {

hexColor = "FF" + hexColor;

}

return int.parse(hexColor, radix: 16);

}

ColorHex(final String hexColor) : super(_getColorFromHex(hexColor));

}

你可能感兴趣的:(flutter,java,android)