nor detecting the pixel of a given color

I am trying to find the grey pixels in an image. The image has exactly 6 of them. the image is here
alt text

This is my code.

    void GetPlayerSpawnPoints ( Texture2D imageMap )
    {
        Color PlayerColor = new Color(0.5f, 0.5f, 0.5f, 1f);
        for ( int x = 0; x < imageMap.width; x++ )
        {
            for ( int y = 0; y < imageMap.height; y++ )
            {
                //GetSpawnPoints ( x, y, imageMap );
                Color pixelColor = imageMap.GetPixel(x, y);

                // is the pixel grey?
                if ( pixelColor == PlayerColor )
                {
                    playerSpawnPoints.Add ( new PlayerSpawnData ( x + ( mapOffsetX * imageMap.width ), y + ( mapOffsetY * imageMap.height ) ) );
                    Debug.Log ( "FOUND" );
                }
            }
        }
    }

For some reason, the code does not find the grey pixel but it does find the black and the blue ones. Can someone help, please.

Well, colors in your texture are most likely stored in Color32 format (most commonly not true for HDR textures or some special formats). So GetPixel() does a conversion from byte to float, which quite possibly means that your color channel is never exactly 0.5f. Basically, hoping that two floats whose values have different origins (are not a copy of each other) is always naive. You could include some value tolerance, compare Color32 instead of color (using GetPixel32() ) etc