网站/APP 转黑白

网站/App转黑白代码: 


网站一句话转黑白:修改body 

<body style="filter: grayscale(100%);">

Flutter:

ColorFiltered(
    colorFilter.mode(Colors.grey, BlendMode.exclusion),
    child:MaterialApp(
        ///...
    )
)

Android:

Paint paint = new Paint();
ColorMatrix cm = new ColorMatrix();
cm.setSaturation(0);
paint.setColorFilter(new ColorMatrixColorFilter(cm));
getWindow().getDecorView().setLayerType(View.LAYER_TYPE_HARDWARE, paint);

// for webview
webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);


IOS:

参考: https://www.jianshu.com/p/b793b9040557