Package software.amazon.smithy.cli
Interface ColorFormatter
- All Known Implementing Classes:
AnsiColorFormatter
public interface ColorFormatter
Styles text using color codes.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
endStyle
(Appendable appendable) boolean
default void
println
(Appendable appendable, String text, Style... styles) Print a styled line of text to the givenappendable
.void
startStyle
(Appendable appendable, Style... style) default void
style
(Appendable appendable, String text, Style... styles) Styles text using the given styles and writes it to an Appendable.default String
Styles text using the given styles.
-
Method Details
-
style
Styles text using the given styles.- Parameters:
text
- Text to style.styles
- Styles to apply.- Returns:
- Returns the styled text.
-
style
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
Print a styled line of text to the givenappendable
.- 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
-
endStyle
-