- 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 int
color
-
Constructor Summary
Constructors Constructor Description Color256(int color)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
checkColor(int c)
boolean
equals(java.lang.Object other)
java.lang.String
getAnsiBackgroundControlCode()
Gets the ANSI control code for setting the background colourprivate java.lang.String
getAnsiColorCode(int mode)
java.lang.String
getAnsiForegroundControlCode()
Gets the ANSI control code for setting the foreground colourjava.lang.String
toString()
boolean
usesExtendedColors()
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:AnsiColorProvider
Gets the ANSI control code for setting the foreground colour- Specified by:
getAnsiForegroundControlCode
in interfaceAnsiColorProvider
- Returns:
- Foreground control code
-
getAnsiBackgroundControlCode
public java.lang.String getAnsiBackgroundControlCode()
Description copied from interface:AnsiColorProvider
Gets the ANSI control code for setting the background colour- Specified by:
getAnsiBackgroundControlCode
in interfaceAnsiColorProvider
- Returns:
- Background control code
-
usesExtendedColors
public boolean usesExtendedColors()
Description copied from interface:AnsiColorProvider
Gets whether extended colours are used as this will affect the ANSI reset sequence that needs to be used- Specified by:
usesExtendedColors
in 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:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
-