Colors { @NonNull public static String hexName(@ColorInt final int color) { return hexName(color, true); } private  Colors(); @ColorInt static int withAlpha(@ColorInt final int color, @FloatRange(from = 0, to = 1) final float alphaRatio); @ColorInt static int withAlpha(@ColorInt final int color, @IntRange(from = COMPONENT_VALUE_MIN, to = COMPONENT_VALUE_MAX) final int alpha); @ColorInt static int blend(@ColorInt final int first, @ColorInt final int second); @SuppressWarnings("UnnecessaryLocalVariable") @ColorInt static int blend(@ColorInt final int first, @ColorInt final int second, @FloatRange(from = 0, to = 1) final float blendingRatio); @ColorInt static int brighter(@ColorInt final int color, @FloatRange(from = 0, to = 1) final float fraction); @ColorInt static int darker(@ColorInt final int color, @FloatRange(from = 0, to = 1) final float fraction); @ColorInt static int random(final boolean randomAlpha); @NonNull static String hexName(@ColorInt final int color); @NonNull static String hexName(@ColorInt final int color, final boolean withAlpha);  }
@Test public void testHexName() { assertThat(Colors.hexName(Color.RED), is("#ffff0000")); }
@Test public void testHexNameWithoutAlpha() { assertThat(Colors.hexName(Color.RED, false), is("#ff0000")); }