Packages

trait AnsiColor extends AnyRef

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.

ForegroundBackground
BLACK BLACK_B
RED RED_B
GREEN GREEN_B
YELLOW YELLOW_B
BLUE BLUE_B
MAGENTAMAGENTA_B
CYAN CYAN_B
WHITE WHITE_B

Source
AnsiColor.scala
Linear Supertypes
Known Subclasses
Type Hierarchy
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. AnsiColor
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

ANSI Style and Control Codes

  1. final val BLINK: String("\u001B[5m")

    ANSI blink

  2. final val BOLD: String("\u001B[1m")

    ANSI bold

  3. final val INVISIBLE: String("\u001B[8m")

    ANSI invisible

  4. final val RESET: String("\u001B[0m")

    Reset ANSI styles

  5. final val REVERSED: String("\u001B[7m")

    ANSI reversed

  6. final val UNDERLINED: String("\u001B[4m")

    ANSI underlines

ANSI Black

 

  1. final val BLACK: String("\u001B[30m")

    Foreground color for ANSI black

  2. final val BLACK_B: String("\u001B[40m")

    Background color for ANSI black

ANSI Red

 

  1. final val RED: String("\u001B[31m")

    Foreground color for ANSI red

  2. final val RED_B: String("\u001B[41m")

    Background color for ANSI red

ANSI Green

 

  1. final val GREEN: String("\u001B[32m")

    Foreground color for ANSI green

  2. final val GREEN_B: String("\u001B[42m")

    Background color for ANSI green

ANSI Yellow

 

  1. final val YELLOW: String("\u001B[33m")

    Foreground color for ANSI yellow

  2. final val YELLOW_B: String("\u001B[43m")

    Background color for ANSI yellow

ANSI Blue

 

  1. final val BLUE: String("\u001B[34m")

    Foreground color for ANSI blue

  2. final val BLUE_B: String("\u001B[44m")

    Background color for ANSI blue

ANSI Magenta

 

  1. final val MAGENTA: String("\u001B[35m")

    Foreground color for ANSI magenta

  2. final val MAGENTA_B: String("\u001B[45m")

    Background color for ANSI magenta

ANSI Cyan

 

  1. final val CYAN: String("\u001B[36m")

    Foreground color for ANSI cyan

  2. final val CYAN_B: String("\u001B[46m")

    Background color for ANSI cyan

ANSI White

 

  1. final val WHITE: String("\u001B[37m")

    Foreground color for ANSI white

  2. final val WHITE_B: String("\u001B[47m")

    Background color for ANSI white