Issue
this is my code
ColorFiltered(
colorFilter: const ColorFilter.matrix([
0.0, 0.0, 0.0, 0.0, 0.0, //
2.0, 0.0, 0.0, 0.0, 0.0, //
0.0, 0.0, 3.0, 0.0, 0.0, //
0.0, 0.0, 0.0, 1.0, 0.0, //
]),
child: Image.asset(
"assets/step1.png",
height: 50,
width: 50,
),
),
output is blue
I want this blue
color code
#1560BD
What is color matrix for this color code ?
I want like this color (expecting color)
Solution
Try below code hope its help to you, I have refer this or this for Hex to ColorFilter.matrix conversion
ColorFiltered(
colorFilter: const ColorFilter.matrix([
0.08235294117647059,0,0,0,0,
0,0.3764705882352941,0,0,0,
0,0,0.7411764705882353,0,0,
0,0,0,1,0
]),
child: Image.network(
'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl.jpg',
),
),
Answered By – Ravindra S. Patil
Answer Checked By – David Goodson (FlutterFixes Volunteer)