AnsiColors

org.llm4s.trace.AnsiColors
object AnsiColors

ANSI escape codes for terminal color formatting.

Provides a centralized set of color constants used by console-based tracing implementations for improved readability during development and debugging.

Attributes

Note

These codes work on most Unix terminals and Windows Terminal. They may not render correctly in non-ANSI-compatible environments.

Example
import org.llm4s.trace.AnsiColors._
println(s"${GREEN}Success!${RESET}")
println(s"${RED}${BOLD}Error: Something failed${RESET}")
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
AnsiColors.type

Members list

Value members

Concrete methods

def boldColor(text: String, color: String): String

Wraps text in bold color codes with automatic reset.

Wraps text in bold color codes with automatic reset.

Value parameters

color

Color code to apply

text

Text to format

Attributes

Returns

Bold colorized text with reset at the end

def colorize(text: String, color: String): String

Wraps text in color codes with automatic reset.

Wraps text in color codes with automatic reset.

Value parameters

color

Color code to apply

text

Text to colorize

Attributes

Returns

Colorized text with reset at the end

def separator(char: Char, length: Int): String

Creates a separator line of the specified character and length.

Creates a separator line of the specified character and length.

Value parameters

char

Character to repeat (default: '=')

length

Length of the separator (default: 60)

Attributes

Returns

A string of repeated characters

Concrete fields

val BLUE: String

Blue foreground color

Blue foreground color

Attributes

val BOLD: String

Bold text style

Bold text style

Attributes

val CYAN: String

Cyan foreground color

Cyan foreground color

Attributes

val GRAY: String

Gray (bright black) foreground color

Gray (bright black) foreground color

Attributes

val GREEN: String

Green foreground color

Green foreground color

Attributes

val MAGENTA: String

Magenta foreground color

Magenta foreground color

Attributes

val RED: String

Red foreground color

Red foreground color

Attributes

val RESET: String

Reset all formatting to terminal defaults

Reset all formatting to terminal defaults

Attributes

val YELLOW: String

Yellow foreground color

Yellow foreground color

Attributes