Help new person dim led smothly according to temp

That is something I came across, but dont understand how to do.
Mostly because i only know one meathod of smothing, and that is the add on, delay, add on, delay, ect... meathod.
Could you please give some sample code of what you mean?