Class: Yay::ColourWheel

Inherits:
Object
  • Object
show all
Defined in:
lib/yay/colour_wheel.rb

Constant Summary collapse

MISC =

not colours as such. commandline support varies

{
  :reset       => 0,
  :bright      => 1,
  :dim         => 2,
  :underscore  => 4,
  :blink       => 5,
  :reverse     => 7,
  :hidden      => 8,	
  
  :normal      => 0, #alias
  :invert      => 7, #alias
  :inverted    => 7, #alias
  :underscored => 4, #alias
}
FG =
{
  :black   => 30,
  :red     => 31,
  :green   => 32,
  :yellow  => 33,
  :blue    => 34,
  :magenta => 35,
  :cyan    => 36,
  :white   => 37,
}
BG =
{
  :black   => 40,
  :red     => 41,
  :green   => 42,
  :yellow  => 43,
  :blue    => 44,
  :magenta => 45,
  :cyan    => 46,
  :white   => 47
}

Class Method Summary collapse

Class Method Details

.all_namesObject



45
46
47
48
# File 'lib/yay/colour_wheel.rb', line 45

def self.all_names
  # assume BG and FG have the same keys
  MISC.keys | FG.keys
end

.begin_colours(colours) ⇒ Object



50
51
52
# File 'lib/yay/colour_wheel.rb', line 50

def self.begin_colours(colours)
  "\033[#{colours.join(';')}m"
end

.end_colourObject



54
55
56
# File 'lib/yay/colour_wheel.rb', line 54

def self.end_colour()
  "\033[0m"
end