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
Note: list_colour adjusts the colour of the list generated by the list command.
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:
- :red
- :green
- :yellow
- :blue
- :magenta
- :cyan
- :white
- :black
- :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