anti Color Alpha - Android Graphics

Android examples for Graphics:Color Alpha

Description

anti Color Alpha

Demo Code


//package com.java2s;
import android.graphics.Color;

public class Main {

    public static int antiColorAlpha(int alpha, int color) {
        if (-1 == alpha) {
            alpha = Color.alpha(color);
            if (255 == alpha) {
                alpha = 200;/*from   ww w.  j  a  v a  2s  .c o m*/
            }
        }
        int r = Color.red(color);
        int g = Color.green(color);
        int b = Color.blue(color);
        return Color.argb(alpha, 255 - r, 255 - g, 255 - b);
    }
}

Related Tutorials