- java.lang.Object
-
- com.googlecode.lanterna.TextColor.Factory
-
- Enclosing interface:
- TextColor
public static class TextColor.Factory extends java.lang.ObjectUtility class to instantiate colors from other types and definitions
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.PatternINDEXED_COLORprivate static java.util.regex.PatternRGB_COLOR
-
Constructor Summary
Constructors Modifier Constructor Description privateFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TextColorfromString(java.lang.String value)Parses a string into a color.
-
-
-
Method Detail
-
fromString
public static TextColor fromString(java.lang.String value)
Parses a string into a color. The string can have one of three formats:- blue - Constant value from the
TextColor.ANSIenum - #17 - Hash character followed by one to three numbers; picks the color with that index from the 256 color palette
- #1a1a1a - Hash character followed by three hex-decimal tuples; creates an RGB color entry by parsing the tuples as Red, Green and Blue
- Parameters:
value- The string value to parse- Returns:
- A
TextColorthat is either anTextColor.ANSI, anTextColor.Indexedor anTextColor.RGBdepending on the format of the string, ornullifvalueisnull.
- blue - Constant value from the
-
-