flutter
Convert HexColor to Flutter color
Color colorConvert(String color) {
color = color.replaceAll("#", "");
if (color.length == 6) {
return Color(int.parse("0xFF" + color));
} else if (color.length == 8) {
return Color(int.parse("0x" + color));
}
}
Was this helpful?
Similar Posts
- Change the color of icons in appbar flutter
- Change circular progress indicator color in Flutter
- Splash screen icon and color in Flutter
- Convert text of Text widget to uppercase or lowercase in Flutter
- Convert a double to an int in Dart or Flutter
- How to convert String to Int in Flutter
- Convert to two digits