Here you can find the source of colorToStringHex(int red, int green, int blue)
public static String colorToStringHex(int red, int green, int blue)
//package com.java2s; //License from project: Open Source License public class Main { public static String colorToStringHex(int red, int green, int blue) { //@formatter:off return Integer.toHexString(0xF & red >> 4) + Integer.toHexString(0x0F & red) + Integer.toHexString(0xF & green >> 4) + Integer.toHexString(0x0F & green) + Integer.toHexString(0xF & blue >> 4) + Integer.toHexString(0x0F & blue); //@formatter:on }// ww w . ja va 2 s.co m }