🎨
pai CLI & Terminal
colors
ANSI terminal color library. Foreground/background colors, bold/dim styles and 24-bit RGB color for terminal output.
Install ppm install colors
Usage Example
uses colors; // Semantic helpers WriteLn(Success('Build completed in 2.3s')); WriteLn(Error('Connection refused')); WriteLn(Warn('API deprecated')); WriteLn(Info('Loading config...')); // Raw constants WriteLn(Green + 'Custom green' + Reset); WriteLn(Bold + BrightYellow + 'Bold yellow!' + Reset); WriteLn(BgRed + White + ' CRITICAL ' + Reset); // 24-bit RGB WriteLn(RGB(255, 140, 0, 'Orange text')); // Strip ANSI for log files var clean := StripColors(coloredStr);
Features
16 ANSI foreground/background colors
Bold, dim and underline styles
24-bit RGB color via RGB()
Semantic helpers: Success, Error, Warn, Info
StripColors() to remove ANSI codes
← Back to Package Index