get Alpha From RGB - Java 2D Graphics

Java examples for 2D Graphics:Color RGB

Description

get Alpha From RGB

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        int binaryColour = 2;
        System.out.println(getAlphaFromRGB(binaryColour));
    }//  w ww  .  j  a v a 2s.  c o m

    /**
     * untested
     */
    public static int getAlphaFromRGB(int binaryColour) {
        return (binaryColour >> 24) & 0xFF;
    }
}

Related Tutorials