@Test public void colorUtils_RGBToHex() { assertEquals(ColorUtils.RGBToHex(0), "00"); assertEquals(ColorUtils.RGBToHex(16), "10"); assertEquals(ColorUtils.RGBToHex(255), "FF"); }
public static String RGBToHex(int n) { StringBuilder sb = new StringBuilder(); sb.append(Integer.toHexString(n)); if (sb.length() < 2) { sb.insert(0, '0'); } return sb.toString().toUpperCase(); }
ColorUtils { public static String RGBToHex(int n) { StringBuilder sb = new StringBuilder(); sb.append(Integer.toHexString(n)); if (sb.length() < 2) { sb.insert(0, '0'); } return sb.toString().toUpperCase(); } }
ColorUtils { public static String RGBToHex(int n) { StringBuilder sb = new StringBuilder(); sb.append(Integer.toHexString(n)); if (sb.length() < 2) { sb.insert(0, '0'); } return sb.toString().toUpperCase(); } private  ColorUtils(); }
ColorUtils { public static String RGBToHex(int n) { StringBuilder sb = new StringBuilder(); sb.append(Integer.toHexString(n)); if (sb.length() < 2) { sb.insert(0, '0'); } return sb.toString().toUpperCase(); } private  ColorUtils(); static String getRGB(float n); static String RGBToHex(int n); static float[] RGBToHSB(@IntRange(from = 0, to = 255) int r,
                                   @IntRange(from = 0, to = 255) int g,
                                   @IntRange(from = 0, to = 255) int b); static float[] RGBToHSL(@IntRange(from = 0, to = 255) int red,
                                   @IntRange(from = 0, to = 255) int green,
                                   @IntRange(from = 0, to = 255) int blue,
                                   float[] hsl); static String getColorMessage(@IntRange(from = 0, to = 255) int rgbRColor,
                                         @IntRange(from = 0, to = 255) int rgbGColor,
                                         @IntRange(from = 0, to = 255) int rgbBColor,
                                         @IntRange(from = 0, to = 255) int rgbOpacity); static String getComplementaryColorMessage(short[] argbColorValues,
                                                      short[] argbComplementaryColorValues,
                                                      short[] argbContrastColorValues); static int[] hexToRGB(String hexValue); static int[] hexToARGB(String hexValue); static int getComplementaryColor(@IntRange(from = 0, to = 255) int rgbRColor,
                                            @IntRange(from = 0, to = 255) int rgbGColor,
                                            @IntRange(from = 0, to = 255) int rgbBColor); static int getContrastColor(@IntRange(from = 0, to = 255) int rgbRColor,
                                       @IntRange(from = 0, to = 255) int rgbGColor,
                                       @IntRange(from = 0, to = 255) int rgbBColor); }
ColorUtils { public static String RGBToHex(int n) { StringBuilder sb = new StringBuilder(); sb.append(Integer.toHexString(n)); if (sb.length() < 2) { sb.insert(0, '0'); } return sb.toString().toUpperCase(); } private  ColorUtils(); static String getRGB(float n); static String RGBToHex(int n); static float[] RGBToHSB(@IntRange(from = 0, to = 255) int r,
                                   @IntRange(from = 0, to = 255) int g,
                                   @IntRange(from = 0, to = 255) int b); static float[] RGBToHSL(@IntRange(from = 0, to = 255) int red,
                                   @IntRange(from = 0, to = 255) int green,
                                   @IntRange(from = 0, to = 255) int blue,
                                   float[] hsl); static String getColorMessage(@IntRange(from = 0, to = 255) int rgbRColor,
                                         @IntRange(from = 0, to = 255) int rgbGColor,
                                         @IntRange(from = 0, to = 255) int rgbBColor,
                                         @IntRange(from = 0, to = 255) int rgbOpacity); static String getComplementaryColorMessage(short[] argbColorValues,
                                                      short[] argbComplementaryColorValues,
                                                      short[] argbContrastColorValues); static int[] hexToRGB(String hexValue); static int[] hexToARGB(String hexValue); static int getComplementaryColor(@IntRange(from = 0, to = 255) int rgbRColor,
                                            @IntRange(from = 0, to = 255) int rgbGColor,
                                            @IntRange(from = 0, to = 255) int rgbBColor); static int getContrastColor(@IntRange(from = 0, to = 255) int rgbRColor,
                                       @IntRange(from = 0, to = 255) int rgbGColor,
                                       @IntRange(from = 0, to = 255) int rgbBColor);  }