ColorUtil { public static String prependColorTag(final String str, final Color color) { return colorTag(color) + str; }  static String colorTag(Color color); static String prependColorTag(final String str, final Color color); static String wrapWithColorTag(final String str, final Color color); static String toHexColor(final Color color); static Color colorLerp(final Color a, final Color b, final double t); static String colorToHexCode(final Color color); static String colorToAlphaHexCode(final Color color); static boolean isAlphaHex(String hex); static boolean isHex(String hex); static int constrainValue(int value); static Color fromString(String string); static Color fromHex(String hex); static Color fromObject(@Nonnull final Object object); static final int MAX_RGB_VALUE; static final int MIN_RGB_VALUE; static final String CLOSING_COLOR_TAG; }
@Test public void prependColorTag() { COLOR_HEXSTRING_MAP.forEach((color, hex) -> { assertEquals("<col=" + hex + ">test", ColorUtil.prependColorTag("test", color)); assertEquals("<col=" + hex + ">", ColorUtil.prependColorTag("", color)); }); assertEquals("<col=ff0000>94<col=ffffff>/99", ColorUtil.prependColorTag("94" + ColorUtil.prependColorTag("/99", Color.WHITE), Color.RED)); }