I know what you mean, it's the red, blue and green that hurts my eyes.
I experimented a bit and you can use darker colours if that helps. Instead of bright red, blue and green I used a darker shade of each. It hurt my eyes a lot less and the mask still showed up in-game.
EDIT: Keeping the dark red background, I used dark purple and a dark yellow instead of blue and green and it worked also. So this can work with a 6 coloured terrain mask, just using darker colours that are all different from each other.