CMObject
, Tickable
, CMLibrary
, ColorLibrary
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class Brown extends StdLibrary implements ColorLibrary
ColorLibrary.Color, ColorLibrary.Color256, ColorLibrary.ColorState, ColorLibrary.SpecialColor
Modifier and Type | Field | Description |
---|---|---|
protected java.util.Map<java.lang.String,ColorLibrary.Color> |
ansiColorMap |
|
protected java.util.Map<java.lang.Character,ColorLibrary.Color> |
bgCodeMap |
|
protected java.lang.String[] |
clookup |
|
protected ColorLibrary.Color256[] |
color256s |
|
protected java.util.Map<java.lang.Short,ColorLibrary.Color> |
color256to16map |
|
protected java.lang.String[] |
htlookup |
idConverter
COLORCODE_BACKGROUND, COLORCODE_BANSI256, COLORCODE_FANSI256, COLORS_INCARDINALORDER
isDebugging, name, serviceClient, tickStatus
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
Brown() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
activate() |
Activates the library.
|
void |
clearLookups() |
Clears the color code lookup tables so that the next
translations will come from the properties.
|
protected char |
findCodeChar(java.lang.String name) |
|
protected ColorLibrary.SpecialColor |
findCodeColor(java.lang.String name) |
|
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.
|
protected void |
generateRecipes() |
|
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) |
Returns the background ansi code associated with the given
foreground ansi code, or null if no match.
|
protected java.util.Map<java.lang.Character,ColorLibrary.Color> |
getBackgroundCodeMap() |
|
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 |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
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.
|
java.lang.String |
translateCMCodeToFGNumber(java.lang.String code) |
|
protected int |
translateSingleCMCodeToANSIOffSet(java.lang.String code) |
|
ColorLibrary.ColorState |
valueOf(char fg,
char bg) |
Generates a new ColorState object from the given
foreground and background basic 16 ^ color codes.
|
getServiceClient, L, propertiesLoaded, shutdown
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, shutdown, tick
protected java.lang.String[] clookup
protected java.lang.String[] htlookup
protected ColorLibrary.Color256[] color256s
protected final java.util.Map<java.lang.Character,ColorLibrary.Color> bgCodeMap
protected final java.util.Map<java.lang.String,ColorLibrary.Color> ansiColorMap
protected final java.util.Map<java.lang.Short,ColorLibrary.Color> color256to16map
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public final ColorLibrary.ColorState getNormalColor()
ColorLibrary
getNormalColor
in interface ColorLibrary
ColorLibrary.ColorState
public final ColorLibrary.ColorState valueOf(char fg, char bg)
ColorLibrary
valueOf
in interface ColorLibrary
fg
- the foreground color code charbg
- the background color code charColorLibrary.ColorState
protected int translateSingleCMCodeToANSIOffSet(java.lang.String code)
public java.lang.String translateCMCodeToFGNumber(java.lang.String code)
protected java.util.Map<java.lang.Character,ColorLibrary.Color> getBackgroundCodeMap()
public java.lang.String getBackgroundHtmlTag(char codeC)
ColorLibrary
getBackgroundHtmlTag
in interface ColorLibrary
codeC
- the color codepublic java.lang.String getBackgroundAnsiCode(java.lang.String ansi)
getBackgroundAnsiCode
in interface ColorLibrary
ansi
- the foreground ansi colorpublic java.lang.String[] fixPlayerColorDefs(java.lang.String colorDefs)
ColorLibrary
fixPlayerColorDefs
in interface ColorLibrary
colorDefs
- the encoded colorDef to translatepublic java.lang.String translateCMCodeToANSI(java.lang.String code)
ColorLibrary
translateCMCodeToANSI
in interface ColorLibrary
code
- the ^ codeColorLibrary.translateANSItoCMCode(String)
public java.lang.String translateANSItoCMCode(java.lang.String code)
ColorLibrary
translateANSItoCMCode
in interface ColorLibrary
code
- ansi escape sequenceColorLibrary.translateCMCodeToANSI(String)
public java.lang.String mixHTMLCodes(java.lang.String code1, java.lang.String code2)
ColorLibrary
mixHTMLCodes
in interface ColorLibrary
code1
- the first html tagcode2
- the other html tag, or nullColorLibrary.mixColorCodes(String, String)
public java.lang.String mixColorCodes(java.lang.String code1, java.lang.String code2)
ColorLibrary
mixColorCodes
in interface ColorLibrary
code1
- the first ansi escape codecode2
- the other ansi escape code, or nullColorLibrary.mixHTMLCodes(String, String)
public CMMsg fixSourceFightColor(CMMsg msg)
ColorLibrary
fixSourceFightColor
in interface ColorLibrary
msg
- the message to colorizeprotected final ColorLibrary.SpecialColor findCodeColor(java.lang.String name)
protected final char findCodeChar(java.lang.String name)
public java.lang.String[] standardHTMLlookups()
ColorLibrary
standardHTMLlookups
in interface ColorLibrary
ColorLibrary.standardColorLookups()
public void clearLookups()
ColorLibrary
clearLookups
in interface ColorLibrary
public java.lang.String[] standardColorLookups()
ColorLibrary
standardColorLookups
in interface ColorLibrary
ColorLibrary.standardHTMLlookups()
public java.lang.String getColorInfo(boolean doAll256)
ColorLibrary
getColorInfo
in interface ColorLibrary
doAll256
- true to send all 256, false for 16protected void generateRecipes()
public boolean activate()
CMLibrary
activate
in interface CMLibrary
activate
in class StdLibrary
CMLibrary.shutdown()
public ColorLibrary.Color getANSI16Equivalent(short color256Code)
ColorLibrary
getANSI16Equivalent
in interface ColorLibrary
color256Code
- the CM-encoded 256 color numberpublic java.util.Enumeration<ColorLibrary.Color256> getColors256()
ColorLibrary
getColors256
in interface ColorLibrary