When Ravan had got desired Var from Brahma and Mahesh, he came out for victory over Trilok. So at one time he came to Usheerbeej region where Raja Marut was doing Maheshwar Yagya under the guidance of Samvart Muni in which all Devta came to take their share. Indra, Yam, Varun and Kuber were also there.
Seeing Ravan coming, Indra, Yam, Kuber, and Varun, changed their form to peacock, crow, chameleon and swan respectively. Later when Ravan went away, they changed into their real form. Pleased with these animals these Devta gave Var to those of whom they assumed the form to save themselves.
--Indra gave Var to peacock that he should be fearless from snakes and his wings which were only blue till then will then on have thousand eyes.
--Yam gave Var to crow that he would never suffer from any disease, and he need not to fear from death unless somebody kills you fro the purpose to feed the dead, and then only those dead will be satisfied.
--Kuber gave Var to Chameleon that he could be able to save himself by changing colors according to environment thus hiding himself from dangers.
--Varun gave Var to swan that from then on he would be milky while in color.