Index: source/simulation2/components/CCmpMinimap.cpp =================================================================== --- source/simulation2/components/CCmpMinimap.cpp +++ source/simulation2/components/CCmpMinimap.cpp @@ -234,10 +234,22 @@ return; CColor color = cmpPlayer->GetDisplayedColor(); - m_R = (u8) (color.r * 255); - m_G = (u8) (color.g * 255); - m_B = (u8) (color.b * 255); + float c = 50.0f; + m_R = (u8) (contrast(color.r, c) * 255); + m_G = (u8) (contrast(color.g, c) * 255); + m_B = (u8) (contrast(color.b, c) * 255); + } + + private: + float contrast(float color, float c) const + { + float f = (259.0f * (c + 255.0f)) / (255.0f * (259.0f - c)); + float n = ((color - 0.5f) * f) + 0.5f; + if (n < 0.0f) return 0.0f; + if (n > 1.0f) return 1.0f; + return n; + } }; REGISTER_COMPONENT_TYPE(Minimap)