Module: SwarmCLI::V3::ANSIColors
- Defined in:
- lib/swarm_cli/v3/ansi_colors.rb
Overview
Minimal ANSI escape code helpers for terminal styling.
Avoids external dependencies (like Pastel) to keep the V3 CLI lightweight. Each method wraps text in an ANSI escape sequence and appends the reset code.
Constant Summary collapse
- RESET =
"\e[0m"- BOLD =
"\e[1m"- DIM =
"\e[2m"- ITALIC =
"\e[3m"- REVERSE =
"\e[7m"- GREEN =
"\e[32m"- CYAN =
"\e[36m"- YELLOW =
"\e[33m"- RED =
"\e[31m"- BLUE =
"\e[34m"- MAGENTA =
"\e[35m"
Class Method Summary collapse
-
.blue(text) ⇒ String
Blue-colored text.
-
.bold(text) ⇒ String
Bold-styled text.
-
.cyan(text) ⇒ String
Cyan-colored text.
-
.dim(text) ⇒ String
Dim-styled text.
-
.green(text) ⇒ String
Green-colored text.
-
.italic(text) ⇒ String
Italic-styled text.
-
.magenta(text) ⇒ String
Magenta-colored text.
-
.red(text) ⇒ String
Red-colored text.
-
.reverse(text) ⇒ String
Reverse-video styled text.
-
.yellow(text) ⇒ String
Yellow-colored text.
Class Method Details
.blue(text) ⇒ String
Returns blue-colored text.
62 |
# File 'lib/swarm_cli/v3/ansi_colors.rb', line 62 def blue(text) = "#{BLUE}#{text}#{RESET}" |
.bold(text) ⇒ String
Returns bold-styled text.
30 |
# File 'lib/swarm_cli/v3/ansi_colors.rb', line 30 def bold(text) = "#{BOLD}#{text}#{RESET}" |
.cyan(text) ⇒ String
Returns cyan-colored text.
50 |
# File 'lib/swarm_cli/v3/ansi_colors.rb', line 50 def cyan(text) = "#{CYAN}#{text}#{RESET}" |
.dim(text) ⇒ String
Returns dim-styled text.
34 |
# File 'lib/swarm_cli/v3/ansi_colors.rb', line 34 def dim(text) = "#{DIM}#{text}#{RESET}" |
.green(text) ⇒ String
Returns green-colored text.
46 |
# File 'lib/swarm_cli/v3/ansi_colors.rb', line 46 def green(text) = "#{GREEN}#{text}#{RESET}" |
.italic(text) ⇒ String
Returns italic-styled text.
38 |
# File 'lib/swarm_cli/v3/ansi_colors.rb', line 38 def italic(text) = "#{ITALIC}#{text}#{RESET}" |
.magenta(text) ⇒ String
Returns magenta-colored text.
66 |
# File 'lib/swarm_cli/v3/ansi_colors.rb', line 66 def magenta(text) = "#{MAGENTA}#{text}#{RESET}" |
.red(text) ⇒ String
Returns red-colored text.
58 |
# File 'lib/swarm_cli/v3/ansi_colors.rb', line 58 def red(text) = "#{RED}#{text}#{RESET}" |