logging: Call color only once and use the result

First we check if a color is defined and then we call it again
and use the result. Avoid the second call and use the result of
the previous call.
1 file changed