Modulate the color Alpha to new alpha - Android Graphics

Android examples for Graphics:Color Alpha

Description

Modulate the color Alpha to new alpha

Demo Code

//package com.java2s;

public class Main {

    public static int modulateAlpha(int colorAlpha, int alpha) {
        int scale = alpha + (alpha >>> 7); // convert to 0..256
        return colorAlpha * scale >>> 8;
    }//  w  w w . j a  v a  2  s  .co  m
}

Related Tutorials