Here you can find the source of toHex(int r, int g, int b)
public static int toHex(int r, int g, int b)
//package com.java2s; //License from project: Open Source License public class Main { public static int toHex(int r, int g, int b) { int hex = 0; hex = hex | ((r) << 16);//from w w w.j a v a2 s.c o m hex = hex | ((g) << 8); hex = hex | ((b)); return hex; } }