AnsiColor

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
class Object
trait Matchable
class Any
Known subtypes
object AnsiColor.type
object Console.type

Members list

Grouped members

ANSI Style and Control Codes

final val BOLD: "\u001b[1m"

ANSI bold

ANSI bold

Attributes

Source
AnsiColor.scala
final val INVISIBLE: "\u001b[8m"

ANSI invisible

ANSI invisible

Attributes

Source
AnsiColor.scala
final val RESET: "\u001b[0m"

Reset ANSI styles

Reset ANSI styles

Attributes

Source
AnsiColor.scala
final val REVERSED: "\u001b[7m"

ANSI reversed

ANSI reversed

Attributes

Source
AnsiColor.scala
final val UNDERLINED: "\u001b[4m"

ANSI underlines

ANSI underlines

Attributes

Source
AnsiColor.scala

ANSI Black

 

final val BLACK: "\u001b[30m"

Foreground color for ANSI black

Foreground color for ANSI black

Attributes

Source
AnsiColor.scala
final val BLACK_B: "\u001b[40m"

Background color for ANSI black

Background color for ANSI black

Attributes

Source
AnsiColor.scala

ANSI Red

 

final val RED: "\u001b[31m"

Foreground color for ANSI red

Foreground color for ANSI red

Attributes

Source
AnsiColor.scala
final val RED_B: "\u001b[41m"

Background color for ANSI red

Background color for ANSI red

Attributes

Source
AnsiColor.scala

ANSI Green

 

final val GREEN: "\u001b[32m"

Foreground color for ANSI green

Foreground color for ANSI green

Attributes

Source
AnsiColor.scala
final val GREEN_B: "\u001b[42m"

Background color for ANSI green

Background color for ANSI green

Attributes

Source
AnsiColor.scala

ANSI Yellow

 

final val YELLOW: "\u001b[33m"

Foreground color for ANSI yellow

Foreground color for ANSI yellow

Attributes

Source
AnsiColor.scala
final val YELLOW_B: "\u001b[43m"

Background color for ANSI yellow

Background color for ANSI yellow

Attributes

Source
AnsiColor.scala

ANSI Blue

 

final val BLUE: "\u001b[34m"

Foreground color for ANSI blue

Foreground color for ANSI blue

Attributes

Source
AnsiColor.scala
final val BLUE_B: "\u001b[44m"

Background color for ANSI blue

Background color for ANSI blue

Attributes

Source
AnsiColor.scala

ANSI Magenta

 

final val MAGENTA: "\u001b[35m"

Foreground color for ANSI magenta

Foreground color for ANSI magenta

Attributes

Source
AnsiColor.scala
final val MAGENTA_B: "\u001b[45m"

Background color for ANSI magenta

Background color for ANSI magenta

Attributes

Source
AnsiColor.scala

ANSI Cyan

 

final val CYAN: "\u001b[36m"

Foreground color for ANSI cyan

Foreground color for ANSI cyan

Attributes

Source
AnsiColor.scala
final val CYAN_B: "\u001b[46m"

Background color for ANSI cyan

Background color for ANSI cyan

Attributes

Source
AnsiColor.scala

ANSI White

 

final val WHITE: "\u001b[37m"

Foreground color for ANSI white

Foreground color for ANSI white

Attributes

Source
AnsiColor.scala
final val WHITE_B: "\u001b[47m"

Background color for ANSI white

Background color for ANSI white

Attributes

Source
AnsiColor.scala