Put the switch statement outside of loop

The switch statement is inside of the loop but it always resolves to same case.
Put it outside to optimize the code.
When the case is of one specific color, the other colors is always zero and makes no changes to final result.
So, remove the unnecessary code.
4 jobs for colormap in 4 minutes and 34 seconds (queued for 1 second)
latest
Status Job ID Name Coverage
  Docker Image
passed debian-testing #2304557

00:00:27

 
  Build And Test
passed autotools #2304558

00:04:07

passed meson #2304559

00:02:28

passed meson-noglamor #2304560

00:00:44