isHexadecimal static method

bool isHexadecimal(
  1. String s
)

检验字符串是否是表示颜色的字符串

Implementation

static bool isHexadecimal(String s) =>
    hasMatch(s, r'^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$');