Here you can find the source of intToWeb(int color)
public static String intToWeb(int color)
//package com.java2s; //License from project: Open Source License public class Main { public static String intToWeb(int color) { int b = (color) & 0xFF; int g = (color >> 8) & 0xFF; int r = (color >> 16) & 0xFF; return hex2d(Integer.toString(r, 16)) + hex2d(Integer.toString(g, 16)) + hex2d(Integer.toString(b, 16)); }// w ww . j a va 2s .c o m public static String hex2d(String tmp) { if (tmp.length() == 1) return "0" + tmp; else return tmp; } }