Improved colour generation and application to use less cpu cycles.

Now precalculates outline colour to save cycles.
Only changes colour if colour has actually changed.