scala.io.AnsiColor
See theAnsiColor companion object
trait AnsiColor
ANSI escape codes providing control over text formatting and color on supporting text terminals.
ANSI Style and Control Codes
This group of escape codes provides control over text styling. For example, to turn on reverse video with bold and then turn off all styling embed these codes,
import io.AnsiColor._
object ColorDemo extends App {
println(s"${REVERSED}${BOLD}Hello 1979!${RESET}")
}
Foreground and Background Colors
Embedding ANSI color codes in text output will control the text foreground and background colors.
Foreground | Background | |
---|---|---|
BLACK | BLACK_B | |
RED | RED_B | |
GREEN | GREEN_B | |
YELLOW | YELLOW_B | |
BLUE | BLUE_B | |
MAGENTA | MAGENTA_B | |
CYAN | CYAN_B | |
WHITE | WHITE_B |
Attributes
- Companion
- object
- Source
- AnsiColor.scala
- Graph
-
- Supertypes
- Known subtypes
Members list
Grouped members
ANSI Style and Control Codes
ANSI blink
ANSI bold
ANSI invisible
Reset ANSI styles
ANSI reversed
ANSI underlines
In this article