Negate Image Without gray Overlapping

  3d, c++, colors, image-processing, textures

Image negative effect is typically done like this:

pixel = rgb(1, 1 ,1) - pixel

but if the pixel color is close to gray, than:

pixel = rgb(1, 1, 1) - rgb(0.5, 0.5, 0.5) = 0.5

That’s not a problem and it’s how it should be, but for me it is, I am making a crosshair texture in my 3D game, which will be drawn in the center of the screen and I want it to have negative effect, reason for it is clearity, if I were to make crosshair white, it would not be visible when looking on white objects (I know I can make it with black outline so it is visible, but thats ugly), but it still has problems for grayish colors as I described, what can be done to fix that?

Source: Windows Questions C++