- java.lang.Object
-
- com.github.rvesse.airline.io.colors.Color256
-
- All Implemented Interfaces:
AnsiColorProvider
public class Color256 extends java.lang.Object implements AnsiColorProvider
256 colour i.e. palette of 256 colors that most modern terminals will support
-
-
Field Summary
Fields Modifier and Type Field Description private intcolor
-
Constructor Summary
Constructors Constructor Description Color256(int color)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private intcheckColor(int c)booleanequals(java.lang.Object other)java.lang.StringgetAnsiBackgroundControlCode()Gets the ANSI control code for setting the background colourprivate java.lang.StringgetAnsiColorCode(int mode)java.lang.StringgetAnsiForegroundControlCode()Gets the ANSI control code for setting the foreground colourjava.lang.StringtoString()booleanusesExtendedColors()Gets whether extended colours are used as this will affect the ANSI reset sequence that needs to be used
-
-
-
Method Detail
-
checkColor
private int checkColor(int c)
-
getAnsiForegroundControlCode
public java.lang.String getAnsiForegroundControlCode()
Description copied from interface:AnsiColorProviderGets the ANSI control code for setting the foreground colour- Specified by:
getAnsiForegroundControlCodein interfaceAnsiColorProvider- Returns:
- Foreground control code
-
getAnsiBackgroundControlCode
public java.lang.String getAnsiBackgroundControlCode()
Description copied from interface:AnsiColorProviderGets the ANSI control code for setting the background colour- Specified by:
getAnsiBackgroundControlCodein interfaceAnsiColorProvider- Returns:
- Background control code
-
usesExtendedColors
public boolean usesExtendedColors()
Description copied from interface:AnsiColorProviderGets whether extended colours are used as this will affect the ANSI reset sequence that needs to be used- Specified by:
usesExtendedColorsin interfaceAnsiColorProvider- Returns:
- True if extended colours are used, false otherwise
-
getAnsiColorCode
private java.lang.String getAnsiColorCode(int mode)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
-