What is color matrix code of "Denim blue"color on flutter?

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

enter image description here

I want this blue

enter image description here

color code
#1560BD
What is color matrix for this color code ?

I want like this color (expecting color)
enter image description here

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',
        ),
      ),

Result Screen-> image

Answered By – Ravindra S. Patil

Answer Checked By – David Goodson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *