java.lang.Object
com.github.rvesse.airline.io.colors.TrueColor
All Implemented Interfaces:
AnsiColorProvider

public class TrueColor extends Object implements AnsiColorProvider
True (24 bit) colours i.e. 16 million possible colours
  • Field Details

    • r

      private final int r
    • g

      private final int g
    • b

      private final int b
  • Constructor Details

    • TrueColor

      public TrueColor(int red, int green, int blue)
    • TrueColor

      public TrueColor(String hex)
  • Method Details

    • checkColor

      private int checkColor(int c, String argName)
    • getAnsiForegroundControlCode

      public String getAnsiForegroundControlCode()
      Description copied from interface: AnsiColorProvider
      Gets the ANSI control code for setting the foreground colour
      Specified by:
      getAnsiForegroundControlCode in interface AnsiColorProvider
      Returns:
      Foreground control code
    • getAnsiBackgroundControlCode

      public String getAnsiBackgroundControlCode()
      Description copied from interface: AnsiColorProvider
      Gets the ANSI control code for setting the background colour
      Specified by:
      getAnsiBackgroundControlCode in interface AnsiColorProvider
      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 interface AnsiColorProvider
      Returns:
      True if extended colours are used, false otherwise
    • getAnsiColorCode

      private String getAnsiColorCode(int mode)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toHex

      public String toHex()
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object