Using HexResolver
This page explains how to use the hex parser for hex colour codes and gradients
Formatting
Standard Hex Colours:
<#RRGGBB>
<#34ebe5>
Gradient Hex Colours:
<gradient:#RRGGBB:#RRGGBB>
<gradient:#34ebe5:#03fcec>
Gradient Hex Colours with stops:
<gradient:#RRGGBB:#RRGGBB:#RRGGBB...>
<gradient:#34ebe5:#03fcec:#34ebe5>
Parsing String
Parsing a string is a very simple process, if the server supports 1.16 it'll attempt to translate the hex into valid colours otherwise it'll just use the old codes: &a
Using the default regex pattern
Using the default regex pattern
String text = "<#34ebe5> My text";
String parsedText = HexResolver.parseString(text);
Using your own regex pattern
Using your own regex pattern
String text = "<#34ebe5>"
String parsedText = HexResolver.parseString(text, pattern);
Custom patterns only work for the single coloured hex. It will not adjust the format of gradients. This is not adjustable
Last updated
Was this helpful?