Hadithcore
Sahih Muslim, 1534 c
sahih

Ibn Umar (Allah be pleased with them) reported Allah's Messenger (ﷺ) as saying:

Do not buy fruit until its good condition becomes clear, and (the danger) of blight is no more. He said: Its good condition becoming clear implies that it becomes red or yellow.

حَدَّثَنِي زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا جَرِيرٌ، عَنْ يَحْيَى بْنِ سَعِيدٍ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ لاَ تَبْتَاعُوا الثَّمَرَ حَتَّى يَبْدُوَ صَلاَحُهُ وَتَذْهَبَ عَنْهُ الآفَةُ قَالَ يَبْدُوَ صَلاَحُهُ حُمْرَتُهُ وَصُفْرَتُهُ ‏.‏

References2 variants
In-Book Reference
Book 21, Hadith 64
USC-MSA web (English) reference
Book 10, Hadith 3667 (deprecated numbering scheme)