update viewer colours from preferences (fixes #66, also part of issue #37)

Initialise viewer colours from preferences and update them when preferences change. Adapted handling from AbstractTextEditor.