In the figure we have a variation of the previous circuit with only one transistor, using the reference of two diodes. The circuit can keep the current in LEDs constant even when the voltage varies in the range of 6 to 15 V. The circuit is from American documentation.
