Created by: mkernahan
Flatten if/else block to reduce code duplication. Use tertiary for colour setting.