Here you can find the source of invertCanvasColors(Paint paint)
Parameter | Description |
---|---|
paint | a parameter |
public static void invertCanvasColors(Paint paint)
//package com.java2s; import android.graphics.ColorMatrix; import android.graphics.ColorMatrixColorFilter; import android.graphics.Paint; public class Main { /**//from ww w . ja v a 2s . c o m * * @param paint */ public static void invertCanvasColors(Paint paint) { float mx[] = { -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f }; ColorMatrix cm = new ColorMatrix(mx); paint.setColorFilter(new ColorMatrixColorFilter(cm)); } }