Here you can find the source of RGBA(int r, int g, int b, int a)
Parameter | Description |
---|---|
r | integer red |
g | integer green |
b | integer blue |
a | integer alpha |
public static int RGBA(int r, int g, int b, int a)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w . j a va 2s . com*/ * Convert to integer RGBA value * * @param r integer red * @param g integer green * @param b integer blue * @param a integer alpha * * @return single integer representation of the given ints */ public static int RGBA(int r, int g, int b, int a) { return (a << 24) | ((r & 255) << 16) | ((g & 255) << 8) | (b & 255); } }