if the color would match, it would make them a bit harder to detect.

different species of snakes do a bunch of things not to be seen, like going nocturnal or burying themselves in sand, and definitively also some carmouflage.

i wouldnt rule it out, but it may also be a locomotion thing.