@robinpath/color
v0.1.1
Published
Terminal ANSI color utilities: red, green, blue, bold, underline, RGB, and more.
Downloads
146
Readme
@robinpath/color
Terminal ANSI color utilities: red, green, blue, bold, underline, RGB, and more.
Why use this module?
Use the color module to integrate utility capabilities into your RobinPath scripts.
Installation
npm install @robinpath/colorQuick Start
No credentials needed — start using it right away:
set $msg as color.green "success"
print $msgAvailable Functions
| Function | Description |
|----------|-------------|
| color.red | Wrap text in red |
| color.green | Wrap text in green |
| color.blue | Wrap text in blue |
| color.yellow | Wrap text in yellow |
| color.cyan | Wrap text in cyan |
| color.magenta | Wrap text in magenta |
| color.white | Wrap text in white |
| color.gray | Wrap text in gray |
| color.bold | Wrap text in bold |
| color.dim | Wrap text in dim |
| color.italic | Wrap text in italic |
| color.underline | Wrap text with underline |
| color.strikethrough | Wrap text with strikethrough |
| color.bgRed | Wrap text with red background |
| color.bgGreen | Wrap text with green background |
| color.bgBlue | Wrap text with blue background |
| color.strip | Strip all ANSI escape codes from text |
| color.rgb | Wrap text with custom RGB foreground color |
Examples
Wrap text in green foreground color.
set $msg as color.green "success"
print $msgWrap text in blue foreground color.
set $msg as color.blue "info"
print $msgWrap text in yellow foreground color.
set $msg as color.yellow "warning"
print $msgIntegration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/color";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
set $msg as color.green "success"
`);Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/log— Structured logging that can use color for formatted output@robinpath/string— String manipulation utilities for text processing@robinpath/debug— Debug output utilities complemented by color formatting@robinpath/template— Template rendering that can include colored placeholders
License
MIT
