colorize
colorize
colorize/  argv
colorized?
7.4

colorize

 (require colorize) package: colorize

colorize you console as you wish, source code.

NOTE: this is a exported version of ruby gem colorize

procedure

(colorize str    
  color1    
  #:background color2    
  #:style style)  string?
  str : string?
  color1 : symbol?
  color2 : symbol?
  style : symbol?
Colorize str with color1 as it’s foreground color, color2 as it’s background color, and style as the it’s style.

procedure

(colorize/argv sym)  list?

  sym : symbol?
show a list of value for the "colorize"’s possible arguments.

procedure

(colorized? str)  boolean?

  str : string?
check if #code{str} is colorized or not.

Examples:
(colorize/argv 'color)
;=> '(black
; light-black
; red
; light-red
; green
; light-green
; yellow
; light-yellow
; blue
; light-blue
; magenta
; light-magenta
; cyan
; light-cyan
; white
; light-white
; default)
 
(displayln (colorize "red string" 'red))
;=> red string
 
(colorize "this is a red string on blue with underline" 'red #:background 'blue #:style 'underline)
;=> "\e[4;31;44mthis is a red string on blue with underline\e[0m"