new function to deal with the repetition in the code generating the column-side colors