ColorUtils class

颜色工具类

Constructors

ColorUtils()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

colorString(Color color) String?
将color颜色转变为字符串
hexToA(String code) int
hexToB(String code) int
hexToColor(String color, {required Color defaultColor}) Color
颜色值通常遵循RGB/ARGB标准 使用时通常以“ # ”字符开头的8位16进制表示 其中ARGB 依次代表透明度(Alpha)、红色(Red)、绿色(Green)、蓝色(Blue) RGB/ARGB(A表示透明度) RGB #RGB888 ARGB #00RGB888 字符串转换成color
hexToColorARGB(String code, {required Color fallBackColor}) Color
hexToG(String code) int
hexToR(String code) int
isHexadecimal(String color) bool
检查字符串是否为十六进制 Example: HexColor => #12F
toColor(String color, {required Color defaultColor}) Color
将颜色转化为color