public class ColorCodeBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH |
Constructor and Description |
---|
ColorCodeBuilder() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
asColorCodes(StyledFragment fragment)
Convert the given styled fragment into color codes.
|
java.lang.String[] |
build(StyledFragment message)
Convert a message into color-coded text.
|
static java.lang.String |
getAdditive(StyleSet resetTo,
StyleSet resetFrom)
Get the additional color codes needed to set the given style when the current
style is the other given one.
|
static java.lang.String |
getCode(StyleSet style)
Get the formatting and color codes.
|
static java.lang.String |
getFormattingCode(StyleSet style)
Get the formatting codes.
|
protected java.lang.String |
transform(java.lang.String word)
Callback for transforming a word, such as a URL.
|
public static final int GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH
public java.lang.String[] build(StyledFragment message)
message
- the messagepublic static java.lang.String getFormattingCode(StyleSet style)
style
- the stylepublic static java.lang.String getCode(StyleSet style)
style
- the stylepublic static java.lang.String getAdditive(StyleSet resetTo, StyleSet resetFrom)
resetTo
- the style to reset toresetFrom
- the style to reset fromprotected java.lang.String transform(java.lang.String word)
word
- the wordpublic static java.lang.String asColorCodes(StyledFragment fragment)
fragment
- the fragment