All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The best and most preferred time to pray 'Asr ends when the sun becomes yellowish. In other words, the preferred time to pray 'Asr continues as long as the sun is bright white and comes to an end when it becomes yellow.
‘Abdullah Ibn 'Amr narrated that the Prophet said: “The time of 'Asr Prayer comes to an end when the sun becomes yellowish.” [Muslim]
Thus, it is not permitted to delay the 'Asr Prayer until the sun becomes yellow unless there is need, and the time of necessity comes to an end when the sun sets.
One who does not perform 'Asr Prayer in the preferred time, whether or not it is due to some excuse, has to perform it in the time of necessity even in the last moments before the sun sets. Such performance is considered to be in the proper time; i.e., not making up.
Abu Hurayrah, narrated that the Prophet said: “Whoever catches one Rak'ah of 'Asr Prayer before the sun sets (and then prays the remainder of the Prayer after the sun sets) has not missed the 'Asr Prayer.” [Al-Bukhaari and Muslim]
Allah knows best.