static @Nullable TextColor fromHexString(final @NotNull String string) {
    if (string.startsWith(HEX_PREFIX)) {
      try {
        final int hex = Integer.parseInt(string.substring(1), 16);
        return color(hex);
      } catch (final NumberFormatException e) {
        return null;
      }
    }
    return null;
  }
Create a new color from a hex string.

@param string the hex string
@return a new text colour
@since 4.0.0
api/src/main/java/net/kyori/adventure/text/format/TextColor.java