Here you can find the source of rgbToColor(int r, int g, int b)
public static int rgbToColor(int r, int g, int b)
//package com.java2s; //License from project: Apache License public class Main { public static int rgbToColor(int r, int g, int b) { return argbToColor(255, r, g, b); }// w w w.j av a 2s . c om public static int argbToColor(int a, int r, int g, int b) { return (((a & 0xFF) << 24) | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | (b & 0xFF)); } }