Thor::Shell::Color < Thor::Shell::Basic
Inherit from Thor::Shell::Basic and add set_color behavior. Check Thor::Shell::Basic to see all available methods.
| Use Case | Command | Description |
|---|---|---|
| 🎨 Set foreground color | set_color(text, :green) | Color text using ANSI color name |
| 🔍 Check if colors are disabled | are_colors_disabled? | Returns true if color output is suppressed |
| 🖥️ Check terminal color support | can_display_colors? | Returns true if terminal supports ANSI colors |
| 🎯 Set foreground and background | set_color(text, :red, :on_white) | Color text with foreground and background |
BLACK — Set the terminal's foreground ANSI color to black.BLUE — Set the terminal's foreground ANSI color to blue.BOLD — The start of an ANSI bold sequence.CLEAR — Embed in a String to clear all previous ANSI sequences.CYAN — Set the terminal's foreground ANSI color to cyan.GREEN — Set the terminal's foreground ANSI color to green.MAGENTA — Set the terminal's foreground ANSI color to magenta.ON_BLACK — Set the terminal's background ANSI color to black.ON_BLUE — Set the terminal's background ANSI color to blue.ON_CYAN — Set the terminal's background ANSI color to cyan.ON_GREEN — Set the terminal's background ANSI color to green.ON_MAGENTA — Set the terminal's background ANSI color to magenta.ON_RED — Set the terminal's background ANSI color to red.ON_WHITE — Set the terminal's background ANSI color to white.ON_YELLOW — Set the terminal's background ANSI color to yellow.RED — Set the terminal's foreground ANSI color to red.WHITE — Set the terminal's foreground ANSI color to white.YELLOW — Set the terminal's foreground ANSI color to yellow.are_colors_disabled? — Returns true if color output is disabled.can_display_colors? — Returns true if the terminal supports ANSI colors.set_color(string, *colors) — Set the ANSI color of the given string. The colors can be a foreground color, background color, or bold. Returns the colored string.Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-29 12:34 @216.73.217.111
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format