Class: RicColorsObsolete::RicColor

Inherits:
String
  • Object
show all
Defined in:
lib/ric_colors.rb

Overview

nero) shift; echo -en "\033[0;30m$\033[0m\n" ;; rossone) shift; echo -en "\033[0;31m$\033[0m\n" ;; verdone) shift; echo -en "\033[0;32m$\033[0m\n" ;; marrone) shift; echo -en "\033[0;33m$\033[0m\n" ;; bluino) shift; echo -en "\033[0;34m$\033[0m\n" ;; porpora) shift; echo -en "\033[0;35m$\033[0m\n" ;; ciano) shift; echo -en "\033[0;36m$\033[0m\n" ;; grigino) shift; echo -en "\033[0;37m$\033[0m\n" ;;

grigione) shift; echo -en "\033[1;30m$*\033[0m\n" ;;
rosso)    shift; echo -en "\033[1;31m$*\033[0m\n" ;;
verde)    shift; echo -en "\033[1;32m$*\033[0m\n" ;;
giallo)   shift; echo -en "\033[1;33m$*\033[0m\n" ;;
blu)      shift; echo -en "\033[1;34m$*\033[0m\n" ;;
viola)    shift; echo -en "\033[1;35m$*\033[0m\n" ;;
azzurro)    shift; echo -en "\033[1;36m$*\033[0m\n" ;;
bianco)   shift; echo -en "\033[1;37m$*\033[0m\n" ;;

arancio)  shift; echo -en "\033[5;31m$*\033[0m\n" ;;

colour_codes = {
      'black':        '\033[0;30m',
      'red':          '\033[0;31m',
      'green':        '\033[0;32m',
      'yellow':       '\033[0;33m',
      'blue':         '\033[0;34m',
      'magenta':      '\033[0;35m',
      'cyan':         '\033[0;36m',
      'white':        '\033[0;37m',
      'darkgray':     '\033[1;30m',
      'br-red':       '\033[1;31m',
      'br-green':     '\033[1;32m',
      'br-yellow':    '\033[1;33m',
      'br-blue':      '\033[1;34m',
      'br-magenta':   '\033[1;35m',
      'br-cyan':      '\033[1;36m',
      'br-white':     '\033[1;37m',
      'ul-black':     '\033[4;30m',
      'ul-red':       '\033[4;31m',
      'ul-green':     '\033[4;32m',
      'ul-yellow':    '\033[4;33m',
      'ul-blue':      '\033[4;34m',
      'ul-magenta':   '\033[4;35m',
      'ul-cyan':      '\033[4;36m',
      'ul-white':     '\033[4;37m',
      'default':      '\033[0m'
}

Constant Summary

Constants inherited from String

String::RICVERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from String

#append, #asterisks, #basename, #canonicalize, #depurate_for_file, #double_quote, #escape_double_quotes, #escape_printf, #escape_single_quotes, #flag, #from_first_line_matching, #grep_color, #initial, #left, #nlines, #prepend, #quote, #sanitize_path, #shorten, #singolarizza, #tee, #to_class, #to_first_line_matching, #to_hash, #trim, #uncolor

Methods included from RicDebug

#to_verbose_s, #trace, #whoami?

Constructor Details

#initialize(mycol) ⇒ RicColor

Returns a new instance of RicColor.



283
284
285
286
# File 'lib/ric_colors.rb', line 283

def initialize(mycol)
  super
  @color = mycol
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



281
282
283
# File 'lib/ric_colors.rb', line 281

def color
  @color
end

Instance Method Details

#to_htmlObject



292
293
294
# File 'lib/ric_colors.rb', line 292

def to_html
  "<font color=\"#{@color}\" >#{self}</font>"
end

#to_sObject



288
289
290
# File 'lib/ric_colors.rb', line 288

def to_s
  'RicColor: ' + self.send(@color)
end