The two main ways to dim an LED are using Pulse Width Modulation (PWM) or Analog Dimming.
With Pulse Width Modulation you have you are basically turning the LED on and off at an extremely fast pace. The fast the past the brighter the LED will be. There are two advantages to using PWM over analog. First your LED will not discolor as much as analog as you are still sending full voltage and current through the LED. You will also save energy as you are not sending that voltage through the LED all the entire time that the LED is on. The disadvantage to a PWM circuit is the controller or circuitry that is required to generate the PWM waveform.
With analog dimming you have a simpler circuit as you are regulating the current supplied to the LED. This can lead to discoloration in the LED as the current required reach max brightness is not available. This method is also wasteful as the additional current is still being turned into heat instead of light by the regulator.