or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

advanced-features.mdbackground-colors.mdbright-colors.mdconfiguration.mdindex.mdsymbols.mdtext-colors.mdtext-modifiers.md
tile.json

text-colors.mddocs/

Text Colors

Standard foreground color functions for terminal text styling. These functions apply ANSI escape codes to change the text color while preserving the background color.

Capabilities

Standard Colors

Apply standard ANSI foreground colors to text.

/**
 * Apply black foreground color to text
 * @param text - The text to style
 * @returns Styled text with ANSI escape codes
 */
function black(text: string): string;

/**
 * Apply red foreground color to text  
 * @param text - The text to style
 * @returns Styled text with ANSI escape codes
 */
function red(text: string): string;

/**
 * Apply green foreground color to text
 * @param text - The text to style  
 * @returns Styled text with ANSI escape codes
 */
function green(text: string): string;

/**
 * Apply yellow foreground color to text
 * @param text - The text to style
 * @returns Styled text with ANSI escape codes  
 */
function yellow(text: string): string;

/**
 * Apply blue foreground color to text
 * @param text - The text to style
 * @returns Styled text with ANSI escape codes
 */
function blue(text: string): string;

/**
 * Apply magenta foreground color to text
 * @param text - The text to style
 * @returns Styled text with ANSI escape codes
 */
function magenta(text: string): string;

/**
 * Apply cyan foreground color to text  
 * @param text - The text to style
 * @returns Styled text with ANSI escape codes
 */
function cyan(text: string): string;

/**
 * Apply white foreground color to text
 * @param text - The text to style
 * @returns Styled text with ANSI escape codes
 */
function white(text: string): string;

Gray Colors

Gray color variants with alias support.

/**
 * Apply gray foreground color to text
 * @param text - The text to style
 * @returns Styled text with ANSI escape codes
 */
function gray(text: string): string;

/**
 * Apply grey foreground color to text (alias for gray)
 * @param text - The text to style  
 * @returns Styled text with ANSI escape codes
 */
function grey(text: string): string;

Usage Examples:

const colors = require('ansi-colors');

// Basic color usage
console.log(colors.red('Error: Something went wrong'));
console.log(colors.green('Success: Operation completed'));
console.log(colors.yellow('Warning: Check your input'));
console.log(colors.blue('Info: Processing data'));

// Chaining with other styles
console.log(colors.red.bold('Critical error!'));
console.log(colors.green.underline('Important success message'));

// Nested colors
console.log(colors.cyan(`Status: ${colors.yellow('pending')} - please wait`));

// Gray aliases
console.log(colors.gray('Disabled option'));
console.log(colors.grey('Disabled option')); // Same as gray