The Messenger of Allah ﷺ said, "Khidr was named so because he once sat upon a patch of white, barren ground, and it stirred beneath him, turning green."
حدثنا يحيى بن موسى حدثنا عبد الرزاق أخبرنا معمر عن همام بن منبه
قال رسول الله ﷺ إنما سمي الخضر لأنه جلس على فروة بيضاء فاهتزت تحته خضراء
Bukhari also narrated it in the Book of the Prophets, the chapter on the story of Khidr with Musa, peace be upon them, hadith no. 3402, from the hadith of Mamar, transmitted by him, and it is found in Sahifah Hammam bin Munabbih, hadith no. 113.