-
-
Notifications
You must be signed in to change notification settings - Fork 52
Closed
Labels
Milestone
Description
class AnsiCode {
PREFIX
SUFFIX
SEPARATOR
//builder pattern
constructor().withTextColor(...).withBackColor(...).build()
String generateCode() {
//returns ansi escape code (for printing)
}
String generateEscapedCode() {
//returns escaped ansi escape code (for unit tests and debugging)
}
}
// NEW - creation
AnsiCode format = new AnsiCode().withTextColor(FColor.Red).build()
ColoredPrinter cp = new ColoredPrinter().withFormat(format).build()
// OLD - usage
//ColoredPrinter.println("message", Attr.Bold, FColor.Blue, BColor.Red)
// NEW
AnsiCode warning = new AnsiCode().withTextColor(FColor.Yellow).build()
ColoredPrinter.println("message", warning)Reactions are currently unavailable