Set the alpha component of color to be alpha . - Android Graphics

Android examples for Graphics:Color Alpha

Description

Set the alpha component of color to be alpha .

Demo Code


//package com.java2s;

public class Main {
    /**/*from w w  w .  ja v a 2 s .co  m*/
     * Set the alpha component of {@code color} to be {@code alpha}.
     */
    static int modifyAlpha(int color, int alpha) {
        return (color & 0x00ffffff) | (alpha << 24);
    }
}

Related Tutorials