code: private static String getHexSingle(String hex, int colorIndex) {
  		validateHex(hex);
  
  		if (hex.startsWith("#")) {
  			hex = hex.substring(1);
  		}
  
  		int colorCharacters = 1;
  		int numColors = hex.length();
  		if (numColors > 4) {
  			colorCharacters++;
  			numColors /= 2;
  		}
  
  		String color = null;
  		if (colorIndex >= 0 || numColors > 3) {
  			if (numColors > 3) {
  				colorIndex++;
  			}
  			int startIndex = colorIndex;
  			if (colorCharacters > 1) {
  				startIndex *= 2;
  			}
  			color = hex.substring(startIndex, startIndex + colorCharacters);
  			color = expandShorthandHexSingle(color);
  		}
  
  		return color;
  	}
docs: Get the hex single color
  
  @param hex
  hex color
  @param colorIndex
  red=0, green=1, blue=2, alpha=-1
  @return hex single color in format FF or null