Reputation: 63
am a newbie in flutter. If i want to use this color hex code #6c63ff and #eee7f7 in flutter, what will it be like. Colors."what" ??
And if i want to write it in this format Color(xofffefddcc)
How will i write it. Thanks
Upvotes: 0
Views: 407
Reputation: 3298
To create Color from hex code just use constructor:
/*
AA – alpha value in hex
RR – red value in hex
GG – green value in hex
BB – the blue value in hex
*/
final color = Color(0xAARRGGBB);
Color with your hex code will be Color(0xff6c63ff)
.
Upvotes: 1