- java.lang.Object
-
- com.github.rvesse.airline.io.colors.TrueColor
-
- All Implemented Interfaces:
AnsiColorProvider
public class TrueColor extends java.lang.Object implements AnsiColorProvider
True (24 bit) colours i.e. 16 million possible colours
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
checkColor(int c, java.lang.String argName)
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
toHex()
java.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, java.lang.String argName)
-
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
-
toHex
public java.lang.String toHex()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
-