java
Paint paint = new Paint();
ColorMatrix colorMatrix= new ColorMatrix();
colorMatrix.setSaturation(0);
paint.setColorFilter(new ColorMatrixColorFilter(colorMatrix));
getWindow().getDecorView().setLayerType(View.LAYER_TYPE_HARDWARE, paint);
kotlin
val paint = Paint()
val colorMatrix = ColorMatrix()
colorMatrix.setSaturation(0F)
paint.setColorFilter(ColorMatrixColorFilter(colorMatrix))
window.decorView.setLayerType(View.LAYER_TYPE_HARDWARE,paint)