An apparatus for controlling current in an array of one or more light-emitting diodes (LEDs), comprising: a switching element disposed between a power supply (V EXT) and the LED array; a current-sensing element configured to produce a signal indicative of the current in the one or more LEDs, the apparatus being characterised in that it further comprises: a first digital-to-analog converter, DAC, and a second DAC, the first and second DACs configured to convert digital values into a high trip voltage (U TH) and a low trip voltage (L TH), respectively; an inverting hysteretic comparator; a digital controller configured to receive a user input and to adjust an average/RMS value of a current flowing through the LED array, the digital controller further configured to calculate the digital values based on the user input, and supply the digital values to the first and second DACs; a multiplexer configured to receive the high and low trip voltage (U TH, L TH) and to select one of the high and low trip voltage to be applied to the inverting hysteretic comparator based on an output of the inverting hysteretic comparator; a switching controller configured to control the switching element to switch the power supply on and off with respect to the LED array, based on the low trip voltage or the high trip voltage, to hysteretically control the current flowing through the LED array; and a single-ended amplifier configured to receive and amplify the signal from the current-sensing element, the amplified signal being sent to the switching controller, wherein the switching controller performs hysteretic control based on the amplified signal. a switching element disposed between a power supply (V EXT) and the LED array; a current-sensing element configured to produce a signal indicative of the current in the one or more LEDs, the apparatus being characterised in that it further comprises: a first digital-to-analog converter, DAC, and a second DAC, the first and second DACs configured to convert digital values into a high trip voltage (U TH) and a low trip voltage (L TH), respectively; an inverting hysteretic comparator; a digital controller configured to receive a user input and to adjust an average/RMS value of a current flowing through the LED array, the digital controller further configured to calculate the digital values based on the user input, and supply the digital values to the first and second DACs; a multiplexer configured to receive the high and low trip voltage (U TH, L TH) and to select one of the high and low trip voltage to be applied to the inverting hysteretic comparator based on an output of the inverting hysteretic comparator; a switching controller configured to control the switching element to switch the power supply on and off with respect to the LED array, based on the low trip voltage or the high trip voltage, to hysteretically control the current flowing through the LED array; and a single-ended amplifier configured to receive and amplify the signal from the current-sensing element, the amplified signal being sent to the switching controller, wherein the switching controller performs hysteretic control based on the amplified signal. a first digital-to-analog converter, DAC, and a second DAC, the first and second DACs configured to convert digital values into a high trip voltage (U TH) and a low trip voltage (L TH), respectively; an inverting hysteretic comparator; a digital controller configured to receive a user input and to adjust an average/RMS value of a current flowing through the LED array, the digital controller further configured to calculate the digital values based on the user input, and supply the digital values to the first and second DACs; a multiplexer configured to receive the high and low trip voltage (U TH, L TH) and to select one of the high and low trip voltage to be applied to the inverting hysteretic comparator based on an output of the inverting hysteretic comparator; a switching controller configured to control the switching element to switch the power supply on and off with respect to the LED array, based on the low trip voltage or the high trip voltage, to hysteretically control the current flowing through the LED array; and a single-ended amplifier configured to receive and amplify the signal from the current-sensing element, the amplified signal being sent to the switching controller, wherein the switching controller performs hysteretic control based on the amplified signal.