Java examples for 2D Graphics:Color RGB
Get the alpha value of a 32-bit ARGB color
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { int argb = 2; System.out.println(getAlpha(argb)); }/*from ww w. j a v a2s . c o m*/ /** * Get the alpha value of a 32-bit ARGB color * * @param rgb * @return */ public static int getAlpha(int argb) { return argb >> 24; } }