Created
December 10, 2019 10:44
-
-
Save aliemir/3041139b1b6ccf9ccd5fc59506315e67 to your computer and use it in GitHub Desktop.
Turn every color to MaterialColor for Flutter - Snippet
This file contains 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
{ | |
"Custom Color Snippet": { | |
"prefix": "customcolor", | |
"body": [ | |
"Map<int, Color> $4 = {", | |
"\t50:Color.fromRGBO($1, $2, $3, .1),", | |
"\t100:Color.fromRGBO($1, $2, $3, .2),", | |
"\t200:Color.fromRGBO($1, $2, $3, .3),", | |
"\t300:Color.fromRGBO($1, $2, $3, .4),", | |
"\t400:Color.fromRGBO($1, $2, $3, .5),", | |
"\t600:Color.fromRGBO($1, $2, $3, .7),", | |
"\t500:Color.fromRGBO($1, $2, $3, .6),", | |
"\t700:Color.fromRGBO($1, $2, $3, .8),", | |
"\t800:Color.fromRGBO($1, $2, $3, .9),", | |
"\t900:Color.fromRGBO($1, $2, $3, 1)", | |
"};$0" | |
], | |
"description": "Turn any rgb color to material color for flutter" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this and then you can initialize a MaterialColor like