ANSI

These strings can be embedded in text when writing to a StdStream to create a text-based UI.

primitive val ANSI

Constructors

create

new val create()
: ANSI val^

Returns


Public Functions

up

Move the cursor up n lines. 0 is the same as 1.

fun box up(
  n: U32 val = seq)
: String val

Parameters

  • n: U32 val = seq

Returns


down

Move the cursor down n lines. 0 is the same as 1.

fun box down(
  n: U32 val = seq)
: String val

Parameters

  • n: U32 val = seq

Returns


Move the cursor right n columns. 0 is the same as 1.

fun box right(
  n: U32 val = seq)
: String val

Parameters

  • n: U32 val = seq

Returns


left

Move the cursor left n columns. 0 is the same as 1.

fun box left(
  n: U32 val = seq)
: String val

Parameters

  • n: U32 val = seq

Returns


cursor

Move the cursor to line y, column x. 0 is the same as 1. This indexes from the top left corner of the screen.

fun box cursor(
  x: U32 val = seq,
  y: U32 val = seq)
: String val

Parameters

  • x: U32 val = seq
  • y: U32 val = seq

Returns


clear

Clear the screen and move the cursor to the top left corner.

fun box clear()
: String val

Returns


erase

Erases everything to the left of the cursor on the line the cursor is on.

fun box erase()
: String val

Returns


reset

Resets all colours and text styles to the default.

fun box reset()
: String val

Returns


bold

Bold text. Does nothing on Windows.

fun box bold(
  state: Bool val = seq)
: String val

Parameters

  • state: Bool val = seq

Returns


underline

Underlined text. Does nothing on Windows.

fun box underline(
  state: Bool val = seq)
: String val

Parameters

  • state: Bool val = seq

Returns


Blinking text. Does nothing on Windows.

fun box blink(
  state: Bool val = seq)
: String val

Parameters

  • state: Bool val = seq

Returns


reverse

Swap foreground and background colour.

fun box reverse(
  state: Bool val = seq)
: String val

Parameters

  • state: Bool val = seq

Returns


black

Black text.

fun box black()
: String val

Returns


red

Red text.

fun box red()
: String val

Returns


green

Green text.

fun box green()
: String val

Returns


yellow

Yellow text.

fun box yellow()
: String val

Returns


blue

Blue text.

fun box blue()
: String val

Returns


magenta

Magenta text.

fun box magenta()
: String val

Returns


cyan

Cyan text.

fun box cyan()
: String val

Returns


grey

Grey text.

fun box grey()
: String val

Returns


white

White text.

fun box white()
: String val

Returns


bright_red

Bright red text.

fun box bright_red()
: String val

Returns


bright_green

Bright green text.

fun box bright_green()
: String val

Returns


bright_yellow

Bright yellow text.

fun box bright_yellow()
: String val

Returns


bright_blue

Bright blue text.

fun box bright_blue()
: String val

Returns


bright_magenta

Bright magenta text.

fun box bright_magenta()
: String val

Returns


bright_cyan

Bright cyan text.

fun box bright_cyan()
: String val

Returns


bright_grey

Bright grey text.

fun box bright_grey()
: String val

Returns


black_bg

Black background.

fun box black_bg()
: String val

Returns


red_bg

Red background.

fun box red_bg()
: String val

Returns


green_bg

Green background.

fun box green_bg()
: String val

Returns


yellow_bg

Yellow background.

fun box yellow_bg()
: String val

Returns


blue_bg

Blue background.

fun box blue_bg()
: String val

Returns


magenta_bg

Magenta background.

fun box magenta_bg()
: String val

Returns


cyan_bg

Cyan background.

fun box cyan_bg()
: String val

Returns


grey_bg

Grey background.

fun box grey_bg()
: String val

Returns


white_bg

White background.

fun box white_bg()
: String val

Returns


bright_red_bg

Bright red background.

fun box bright_red_bg()
: String val

Returns


bright_green_bg

Bright green background.

fun box bright_green_bg()
: String val

Returns


bright_yellow_bg

Bright yellow background.

fun box bright_yellow_bg()
: String val

Returns


bright_blue_bg

Bright blue background.

fun box bright_blue_bg()
: String val

Returns


bright_magenta_bg

Bright magenta background.

fun box bright_magenta_bg()
: String val

Returns


bright_cyan_bg

Bright cyan background.

fun box bright_cyan_bg()
: String val

Returns


bright_grey_bg

Bright grey background.

fun box bright_grey_bg()
: String val

Returns


eq

fun box eq(
  that: ANSI val)
: Bool val

Parameters

Returns


ne

fun box ne(
  that: ANSI val)
: Bool val

Parameters

Returns