| 
 | PircBot Java IRC Bot | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jibble.pircbot.Colors
The Colors class provides several static fields and methods that you may find useful when writing an IRC Bot.
This class contains constants that are useful for formatting lines sent to IRC servers. These constants allow you to apply various formatting to the lines, such as colours, boldness, underlining and reverse text.
The class contains static methods to remove colours and formatting from lines of IRC text.
Here are some examples of how to use the contants from within a class that extends PircBot and imports org.jibble.pircbot.*;
 sendMessage("#cs", Colors.BOLD + "A bold hello!");
     A bold hello!
 sendMessage("#cs", Colors.RED + "Red" + Colors.NORMAL + " text");
     Red text
 sendMessage("#cs", Colors.BOLD + Colors.RED + "Bold and red");
     Bold and red
 
 Please note that some IRC channels may be configured to reject any
 messages that use colours.  Also note that older IRC clients may be
 unable to correctly display lines that contain colours and other
 control characters.
  Note that this class name has been spelt in the American style in order to remain consistent with the rest of the Java API.
| Field Summary | |
| static String | BLACKBlack coloured text. | 
| static String | BLUEBlue coloured text. | 
| static String | BOLDBold text. | 
| static String | BROWNBrown coloured text. | 
| static String | CYANCyan coloured text. | 
| static String | DARK_BLUEDark blue coloured text. | 
| static String | DARK_GRAYDark gray coloured text. | 
| static String | DARK_GREENDark green coloured text. | 
| static String | GREENGreen coloured text. | 
| static String | LIGHT_GRAYLight gray coloured text. | 
| static String | MAGENTAMagenta coloured text. | 
| static String | NORMALRemoves all previously applied color and formatting attributes. | 
| static String | OLIVEOlive coloured text. | 
| static String | PURPLEPurple coloured text. | 
| static String | REDRed coloured text. | 
| static String | REVERSEReversed text (may be rendered as italic text in some clients). | 
| static String | TEALTeal coloured text. | 
| static String | UNDERLINEUnderlined text. | 
| static String | WHITEWhite coloured text. | 
| static String | YELLOWYellow coloured text. | 
| Method Summary | |
| static String | removeColors(String line)Removes all colours from a line of IRC text. | 
| static String | removeFormatting(String line)Remove formatting from a line of IRC text. | 
| static String | removeFormattingAndColors(String line)Removes all formatting and colours from a line of IRC text. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
public static final String NORMAL
public static final String BOLD
public static final String UNDERLINE
public static final String REVERSE
public static final String WHITE
public static final String BLACK
public static final String DARK_BLUE
public static final String DARK_GREEN
public static final String RED
public static final String BROWN
public static final String PURPLE
public static final String OLIVE
public static final String YELLOW
public static final String GREEN
public static final String TEAL
public static final String CYAN
public static final String BLUE
public static final String MAGENTA
public static final String DARK_GRAY
public static final String LIGHT_GRAY
| Method Detail | 
public static String removeColors(String line)
line - the input text.
public static String removeFormatting(String line)
line - the input text.
public static String removeFormattingAndColors(String line)
line - the input text.
| 
 | PircBot Java IRC Bot | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||