这是我的代码

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

输出为蓝色

enter image description here

我想要这个蓝色的

enter image description here

色码 #1560BD个 这个 colored颜色 代码的 colored颜色 矩阵是什么?

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

推荐答案

try 下面的代码希望它能对你有帮助,我已经推荐了thisthis进行102转换

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

Flutter相关问答推荐

创建多个具有适当填充和对齐的按钮的最佳方法

我可以在iOS设备上使用Ffltter实现Google Pay按钮吗?

Flutter 图标记移动

如何在Flutter 中创造以下效果

Flutter如何将2个以上的值传递到ListView上的另一个屏幕?

Flutter飞溅屏幕即使在修改后仍显示默认徽标和背景色

Flutter在CustomPainter的右上角和左上角添加了2条曲线

我如何在Android 13中通过Flutter应用程序打开文件(不是图像、视频或音频)?

如何对齐 AppBar Actions 中的文本?

如何给按钮的边框半径?

在使用 Android 12+ 的真实 Android 设备上,SingleChildScrollView 中最初位于视口之外的无响应 Web 视图

允许文本小部件在容器之间溢出

Android 模拟器在 Apple M2 芯片 EXC_BAD_ACCESS / KERN_INVALID_ADDRESS 上随机崩溃

我可以在列表图块下方添加其他小部件吗

Flutter canvas 绘制不同 colored颜色 的原始点

Container 的 Flutter 背景图片不会出现

从子集合sem中获取参考学年&&课程名称的值

我无法从 Cloud firestore 访问文档字段并在 statefulwidget 类中显示它

如何在Flutter 中水平滚动堆叠定位的小部件?

为什么这个参数类型不能分配给参数类型?