Modifier and Type | Interface | Description |
---|---|---|
static class |
ColorLibrary.Color |
These are the straight color codes and character codes
such as blink adn so forth.
|
static interface |
ColorLibrary.Color256 |
The object with information about all
supported ANSI-256 colors
|
static interface |
ColorLibrary.ColorState |
A color state is a class saved for users so the system knows
what the current color situation is, which allows it to go
back when it changes.
|
static class |
ColorLibrary.SpecialColor |
The special color codes are named color codes which are
usually renameable by the user to other basic colors.
|
Modifier and Type | Field | Description |
---|---|---|
static char |
COLORCODE_BACKGROUND |
Color code prefix to designate background color (^ for foreground)
|
static char |
COLORCODE_BANSI256 |
Color code prefix to designate background ansi color
|
static char |
COLORCODE_FANSI256 |
Color code prefix to designate foreground ansi color
|
static ColorLibrary.Color[] |
COLORS_INCARDINALORDER |
The Basic 8 Colors, in their numeric ansi code order.
|
idConverter
Modifier and Type | Method | Description |
---|---|---|
void |
clearLookups() |
Clears the color code lookup tables so that the next
translations will come from the properties.
|
java.lang.String[] |
fixPlayerColorDefs(java.lang.String colorDefs) |
Translates encoded color definition overrides into a
completed color mapping, where mappings are from char
code ints to either escape strings, or more defs.
|
CMMsg |
fixSourceFightColor(CMMsg msg) |
Does nothing more impressive than adding the color codes
for combat to the source and target messages if possible.
|
ColorLibrary.Color |
getANSI16Equivalent(short color256Code) |
Returns the ANSI 16 color equivalent to the given
CM-encoded ANSI 256 color.
|
java.lang.String |
getBackgroundAnsiCode(java.lang.String ansi) |
Given the ansi code for a foreground color, this method
will return the corresponding ansi code for the background
character.
|
java.lang.String |
getBackgroundHtmlTag(char codeC) |
Given a color code (bg or fg), this method will return
the appropriate html tag for the background color.
|
java.lang.String |
getColorInfo(boolean doAll256) |
Returns a friendly readable chart of colors,
formatted for 80 columns.
|
java.util.Enumeration<ColorLibrary.Color256> |
getColors256() |
Returns an enumeration of the supported ansi-256 colors
that are supported by the system in general.
|
ColorLibrary.ColorState |
getNormalColor() |
A ColorState object that represents the basic normal
color, typically grey with no background.
|
java.lang.String |
mixColorCodes(java.lang.String code1,
java.lang.String code2) |
Given a foreground and background set of ansi escape codes,
this method generates a single useable ansi escape code
from the two.
|
java.lang.String |
mixHTMLCodes(java.lang.String code1,
java.lang.String code2) |
Given a foreground and background set of html tags,
this method generates a single useable html tag
from the two.
|
java.lang.String[] |
standardColorLookups() |
Returns the standard ansi escape color lookup table, which
maps an array indexed by the ^ color codes to an ansi escape
color
|
java.lang.String[] |
standardHTMLlookups() |
Returns the standard html tag lookup table, which
maps an array indexed by the ^ color codes to an html
tag.
|
java.lang.String |
translateANSItoCMCode(java.lang.String code) |
Translates an ansi escape sequence to a
basic 16 or special color code, anything
that starts with ^ to the .
|
java.lang.String |
translateCMCodeToANSI(java.lang.String code) |
Translates a basic 16 or special color code, anything
that starts with ^ to the ansi escape sequence.
|
ColorLibrary.ColorState |
valueOf(char fg,
char bg) |
Generates a new ColorState object from the given
foreground and background basic 16 ^ color codes.
|
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, ID, initializeClass, name, newInstance
static final ColorLibrary.Color[] COLORS_INCARDINALORDER
static final char COLORCODE_BACKGROUND
static final char COLORCODE_FANSI256
static final char COLORCODE_BANSI256
void clearLookups()
java.lang.String translateCMCodeToANSI(java.lang.String code)
code
- the ^ codetranslateANSItoCMCode(String)
java.lang.String translateANSItoCMCode(java.lang.String code)
code
- ansi escape sequencetranslateCMCodeToANSI(String)
java.lang.String mixHTMLCodes(java.lang.String code1, java.lang.String code2)
code1
- the first html tagcode2
- the other html tag, or nullmixColorCodes(String, String)
java.lang.String mixColorCodes(java.lang.String code1, java.lang.String code2)
code1
- the first ansi escape codecode2
- the other ansi escape code, or nullmixHTMLCodes(String, String)
java.lang.String getBackgroundAnsiCode(java.lang.String ansi)
ansi
- the foreground ansi colorjava.lang.String getBackgroundHtmlTag(char codeC)
codeC
- the color codeCMMsg fixSourceFightColor(CMMsg msg)
msg
- the message to colorizejava.lang.String[] standardHTMLlookups()
standardColorLookups()
java.lang.String[] standardColorLookups()
standardHTMLlookups()
java.lang.String getColorInfo(boolean doAll256)
doAll256
- true to send all 256, false for 16ColorLibrary.Color getANSI16Equivalent(short color256Code)
color256Code
- the CM-encoded 256 color numberjava.util.Enumeration<ColorLibrary.Color256> getColors256()
java.lang.String[] fixPlayerColorDefs(java.lang.String colorDefs)
colorDefs
- the encoded colorDef to translateColorLibrary.ColorState valueOf(char fg, char bg)
fg
- the foreground color code charbg
- the background color code charColorLibrary.ColorState
ColorLibrary.ColorState getNormalColor()
ColorLibrary.ColorState