Java examples for 2D Graphics:Color RGB
from RGB
//package com.java2s; public class Main { public static int fromRGB(int r, int g, int b) { return fromRGBA(r, g, b, 255); }//from w w w. j a v a 2s . c o m public static int fromRGBA(int r, int g, int b, int a) { return (a & 255) << 24 | (r & 255) << 16 | (g & 255) << 8 | b & 255; } }