Interface ColorFormatter

All Known Implementing Classes:
AnsiColorFormatter

public interface ColorFormatter
Styles text using color codes.
See Also:
  • Method Details

    • style

      default String style(String text, Style... styles)
      Styles text using the given styles.
      Parameters:
      text - Text to style.
      styles - Styles to apply.
      Returns:
      Returns the styled text.
    • style

      default void style(Appendable appendable, String text, Style... styles)
      Styles text using the given styles and writes it to an Appendable.
      Parameters:
      appendable - Where to write styled text.
      text - Text to write.
      styles - Styles to apply.
    • println

      default void println(Appendable appendable, String text, Style... styles)
      Print a styled line of text to the given appendable.
      Parameters:
      appendable - Where to write.
      text - Text to write.
      styles - Styles to apply.
    • isColorEnabled

      boolean isColorEnabled()
      Returns:
      Returns true if this formatter supports color output.
    • startStyle

      void startStyle(Appendable appendable, Style... style)
    • endStyle

      void endStyle(Appendable appendable)