Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ANSIFormat

Hierarchy

  • ANSIFormat

Properties

Static CODE

CODE: object = ...

ANSI codes to manipulate strings

Type declaration

  • Reset: string
  • Bright: string
  • Dim: string
  • Underscore: string
  • Blink: string
  • Reverse: string
  • Hidden: string
  • RGBTextColorPrefix: string
  • RGBBackgroundColorPrefix: string

Methods

Static colorForeground

  • colorForeground(r: number, g: number, b: number): string
  • returns a string to color the following text

    Parameters

    • r: number
    • g: number
    • b: number

    Returns string

Static colorBackground

  • colorBackground(r: number, g: number, b: number): string
  • returns a string to color the following text's background

    Parameters

    • r: number
    • g: number
    • b: number

    Returns string

Static colorHighlight

  • colorHighlight(text: string, color?: string): string
  • returns a string with the highlighted text

    Parameters

    • text: string
    • Optional color: string

    Returns string

Static bgWarn

  • bgWarn(text: string): string
  • returns a string to color the following text's background red

    Parameters

    • text: string

    Returns string

Static fgWarn

  • fgWarn(text: string): string
  • returns a string to color the following text red

    Parameters

    • text: string

    Returns string

Static fgSuccess

  • fgSuccess(text: string): string
  • returns a string to color the following text green

    Parameters

    • text: string

    Returns string

Static fgTime

  • fgTime(text: string): string
  • returns a string to color the following text dark grey

    Parameters

    • text: string

    Returns string

Static fgCloseLog

  • fgCloseLog(text: string): string
  • returns a string to color the following text light green

    Parameters

    • text: string

    Returns string

Static colorize

  • colorize(text: string, color: string, alpha?: number): string
  • receives text color and alpha and returns the colored string

    Parameters

    • text: string
    • color: string
    • alpha: number = 1

    Returns string

Static colorLox

  • colorLox(lox: OutputLox, opacity?: number, highlightColor?: string): object
  • Parameters

    • lox: OutputLox

      to get colored props from

    • opacity: number = 1

      of the returned moduleId

    • Optional highlightColor: string

      for the message (if the lox is highlighted) - defaults to inverted

    Returns object

    the colored props of the given lox

    • message: string
    • moduleText: string
    • timeText: string

Static fgNumber

  • fgNumber(text: string): string
  • used to color items of type number and bigInt

    Parameters

    • text: string

    Returns string

Static fgString

  • fgString(text: string): string
  • used to color items of type string and symbol

    Parameters

    • text: string

    Returns string

Static fgBoolean

  • fgBoolean(text: string): string
  • used to color items of type boolean

    Parameters

    • text: string

    Returns string

Static fgUndefined

  • fgUndefined(text: string): string
  • used to color multiple parts of items especially of type undefined and null

    Parameters

    • text: string

    Returns string

Static fgFunction

  • fgFunction(text: string): string
  • used to color items of type function

    Parameters

    • text: string

    Returns string

Static fgDate

  • fgDate(text: string): string
  • used to color items instance of Date

    Parameters

    • text: string

    Returns string

Static fgLine

  • fgLine(text: string): string
  • used to color indent indicator lines of items

    Parameters

    • text: string

    Returns string

Generated using TypeDoc