The colours we see can sometimes be just an illusion.
The White-headed Duck's bill is bone, supporting a thin layer of living tissue which is then covered again with a thin layer of see-through keratin. The living cells can change colour, and the colour shows through the keratin. In most bird species it's a complex biological operation, but hormonal changes and dietary impacts have conequences. These can be an attempt to impress females and to display their fine physical condition!
However, and because it's the blue colour, in the case of the White Headed Ducks Oxyura leucocephala there is something more complex than just the pigmentation mechanisms. Read more...
Prum, Richard & Torres, Rodolfo. (2003). Structural colouration of avian skin: Convergent evolution of coherently scattering dermal collagen arrays. The Journal of experimental biology. 206. 2409-29. 10.1242/jeb.00431.
https://www.nhpr.org/.../ask-sam-why-do-birds-bills...
https://eu.courierpress.com/.../birds-can.../5009834002/