dahlia/ansi

This module contains tools to work with ansi.

Types

pub type Ansi {
  AnsiColor3(Int)
  AnsiColor4(Int)
  AnsiColor8(Int)
  AnsiColor24(Int, Int, Int)
  AnsiSGR(Int)
}

Constructors

  • AnsiColor3(Int)

    AnsiColor3 uses a single digit code.

  • AnsiColor4(Int)

    AnsiColor4 uses a single digit code.

  • AnsiColor8(Int)

    AnsiColor8 uses a single digit code for a number.

  • AnsiColor24(Int, Int, Int)

    AnsiColor24 is represented as RGB

  • AnsiSGR(Int)

    SGR sequence, such as italics or bold.

Functions

pub fn from_hex(string str: String) -> Result(Ansi, Nil)

Create an AnsiColor24 from a hex value.

let ansi = ansi.from_hex("#FFAFF3")
pub fn serialize(ansi: Ansi, background: Bool) -> String
Search Document