You did not take into account the integer class that you are using.
Most likely the image data is uint8, which supports values from 0 to 255. When you do this:
allcolors = colorimgR+colorimgG+colorimgB
allcolors will also have class uint8, but it is quite likely that many/most of the values saturate to 255 (or close to it) when you add them together. You then divide the individual color channels by 255 (or close to it) to get a very small uint8 value (either one or zero), which therefore appears very close to black:
uint8(198) / uint8(255)
Note how the output is uint8 and its value is one, i.e. very very dark (when interpreted on a scale of 0..255).
I don't really understand how that "normalization" is supposed to work (it does not seem to take into account the sRGB color channel weighting or gamma correction, and if applied to floating point values would still darken them), but for a start you should probably convert the data to double before the addition and other operations.