Program output is configurable, making it possible to change colours to suit the shell background colour, or user preference.

Output introduction

By default CW prints successful words and letters in blue and failed in red. However it is very easy to modify the colours used for printing. This is useful to tune the colours to work against the shell colour in use.

Colour commands

The commands available are:

  • success_colour
  • fail_colour
  • list_colour

Command usage

Here is an example of setting success, fail, and list colours:


cw do
  name 'abbreviations'
  success_colour :green
  fail_colour    :yellow
  list_colour    :cyan
  wpm  18
  ewpm 12
  load_abbreviations
  shuffle
  word_count 4
  list
end

Configuration file

Generally speaking it is more convenient to make colour adjustments to a configuration file as explained here.

Available colours

Available colours are as follows:

  1. :red
  2. :green
  3. :yellow
  4. :blue
  5. :magenta
  6. :cyan
  7. :white
  8. :black
  9. :default (white)

To see all colours in action run the following script:

colours = [:black,:red,:green,:yellow,:blue,
           :magenta,:cyan,:white,:default]
colours.each do |colour|
  cw do
    fail_colour    colour
    success_colour colour
    @words.add [colour.to_s]
  end
end