endOfTag = true; style = createTrimmedString(text, i, findIndex == -1 ? text.length - 1 : findIndex - 1); if (color.charAt(0) == '(') { findIndex = findNext(text, ')', i + colonIndex + 1); style = createTrimmedString(text, i, findIndex + 1); color = style.substring(colonIndex + 1);
private static ParsedStyleResult parseStylePart(char[] text, int start, StyledLabelBuilder builder) { ParsedStyleResult result = new ParsedStyleResult(); int findIndex, i = start; // find end of text first findIndex = findNext(text, ':', i); int indexMatchingBracket = findMatchingBracket(text, start); if (findIndex < 0 || findIndex > indexMatchingBracket) { return null; } result.text = createTrimmedString(text, i, findIndex - 1); return parseStyleAnnotation(text, findIndex + 1, builder, result); }