Here you can find the source of convertHexadecimal2RGB(final String hexColor, final String divider)
public static String convertHexadecimal2RGB(final String hexColor, final String divider)
//package com.java2s; //License from project: Open Source License public class Main { public static String convertHexadecimal2RGB(final String hexColor, final String divider) { final String hex = hexColor.replaceFirst("#", ""); if (hex.length() != 6) { return null; }//ww w .ja v a 2 s. co m final StringBuilder sb = new StringBuilder(); String toCon = hex.substring(0, 2); int color = Integer.parseInt(toCon, 16); sb.append(color); for (int i = 2; i < 6; i += 2) { toCon = hex.substring(i, i + 2); color = Integer.parseInt(toCon, 16); sb.append(divider); sb.append(color); } return sb.toString(); } }