PaintUtils { public static String toHexString(Color color) { return "#" + Integer.toHexString(color.getRGB() | 0xFF000000).substring(2); } private  PaintUtils(); static Paint resizeGradient(Paint p, int width, int height); static Paint getCheckerPaint(); static Paint getCheckerPaint(Paint c1, Paint c2, int size); static String toHexString(Color color); static Color removeAlpha(Color color); static Color setAlpha(Color color, int alpha); static Color setSaturation(Color color, float saturation); static Color setBrightness(Color color, float brightness); static Color blend(Color origin, Color over); static Color interpolate(Color b, Color a, float t); static Color computeForeground(Color bg); static final GradientPaint BLUE_EXPERIENCE; static final GradientPaint MAC_OSX_SELECTED; static final GradientPaint MAC_OSX; static final GradientPaint AERITH; static final GradientPaint GRAY; static final GradientPaint RED_XP; static final GradientPaint NIGHT_GRAY; static final GradientPaint NIGHT_GRAY_LIGHT; static final Paint ORANGE_DELIGHT; static final Paint BLACK_STAR; }
@Test public void testToHexString() { assertThat(PaintUtils.toHexString(Color.BLACK), is("#000000")); assertThat(PaintUtils.toHexString(Color.WHITE), is("#ffffff")); }