The closest you are to a wall, the more light is reflected back, the furthest you are, the less, they just measure how much reflected light there is
And yes, colour does mess with readings sometimes, but those sharp IR detectors have excellent immunity to colour and sun light, they are worth the price.