Here you can find the source of toRGB(String hexString)
public static int[] toRGB(String hexString)
//package com.java2s; //License from project: Apache License public class Main { public static int[] toRGB(int value) { int[] rgb = new int[3]; rgb[0] = value >> 16 & 0xff; rgb[1] = value >> 8 & 0xff; rgb[2] = value & 0xff;/*w w w . j a v a 2 s . c o m*/ return rgb; } public static int[] toRGB(String hexString) { if (hexString.startsWith("0x")) { hexString = hexString.substring(2); } else if (hexString.startsWith("#")) { hexString = hexString.substring(1); } int value = Integer.parseInt(hexString, 16); return toRGB(value); } }