Created
July 20, 2021 19:46
-
-
Save enmanuel97/9232086960bd34d7de6f68c412ea70c7 to your computer and use it in GitHub Desktop.
String to Color - Flutter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Color colorFromHex(String hexColor) { | |
String hexCode = hexColor.replaceAll('#', ''); | |
return Color(int.parse('FF$hexCode', radix: 16)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment