Figures 1 and 2 show an example in which the current is derated to take temperature into account. Toshiba technical data for an LED lamp usually shows the permissible current values against temperature. Please refer to this information when planning a new design.
The following example describes how to derate for temperature when designing:

Figure 1 – Specified by design (22 mA) exceeds permissible value at high temperatures

Figure 2 – Specified by design (22 mA) is within permissible value at high temperatures
Characteristically, the luminous intensity of LEDs gradually decreases over the life of the LED. The rate at which the luminous intensity falls varies according to the material used and the forward current at which the LED is driven. The larger the current, the greater the diminution of luminosity. Thus, when setting the forward current of the LED lamp, do not determine the setting solely from the temperature characteristics, as in the above example, but consider also longevity characteristics. An effective way of improving the longevity characteristics is to set the forward current of the LED lamp relatively low.