toColor method
Implementation
Color? toColor() {
final hex = this?.replaceAll('#', '') ?? '';
if (hex.isEmpty || int.tryParse('FF$hex', radix: 16) == null) {
return null;
}
return Color(int.parse('FF$hex', radix: 16));
}
Color? toColor() {
final hex = this?.replaceAll('#', '') ?? '';
if (hex.isEmpty || int.tryParse('FF$hex', radix: 16) == null) {
return null;
}
return Color(int.parse('FF$hex', radix: 16));
}