Java examples for 2D Graphics:Color RGB
Color to RGBA
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { int a = 2; int r = 2; int g = 2; int b = 2; System.out.println(toRGBA8888(a, r, g, b)); }//from www. j a v a 2 s . com public static int toRGBA8888(final int a, final int r, final int g, final int b) { return (r << 24) + (g << 16) + (b << 8) + a; } }