By default less will display colour escape codes directly and will not interpret them. Some programs will only output colour when running in a colour capable terminal; by default a linux pipe is not considered colour capable. We have to tell them explicitly to generate and process colour escape sequences:
ls --color=always | less -R
For further details see askubuntu link.