@Test public void asHexToHex() { String hex = Colors.asHex("#ffffff"); assertEquals("#ffffff", hex); }
public static String asHex(String color) { Matcher rgbMatcher = RGB_PATTERN.matcher(color); if (rgbMatcher.matches()) { return formatRgbAsHex(asInt(rgbMatcher.group(1)), asInt(rgbMatcher.group(2)), asInt(rgbMatcher.group(3))); } return color; }
Colors { public static String asHex(String color) { Matcher rgbMatcher = RGB_PATTERN.matcher(color); if (rgbMatcher.matches()) { return formatRgbAsHex(asInt(rgbMatcher.group(1)), asInt(rgbMatcher.group(2)), asInt(rgbMatcher.group(3))); } return color; } }
Colors { public static String asHex(String color) { Matcher rgbMatcher = RGB_PATTERN.matcher(color); if (rgbMatcher.matches()) { return formatRgbAsHex(asInt(rgbMatcher.group(1)), asInt(rgbMatcher.group(2)), asInt(rgbMatcher.group(3))); } return color; } private  Colors(); }
Colors { public static String asHex(String color) { Matcher rgbMatcher = RGB_PATTERN.matcher(color); if (rgbMatcher.matches()) { return formatRgbAsHex(asInt(rgbMatcher.group(1)), asInt(rgbMatcher.group(2)), asInt(rgbMatcher.group(3))); } return color; } private  Colors(); static String asHex(String color); }
Colors { public static String asHex(String color) { Matcher rgbMatcher = RGB_PATTERN.matcher(color); if (rgbMatcher.matches()) { return formatRgbAsHex(asInt(rgbMatcher.group(1)), asInt(rgbMatcher.group(2)), asInt(rgbMatcher.group(3))); } return color; } private  Colors(); static String asHex(String color);  }