The brightness of LED could be controlled with slider, using a PWM instead of VDAC.
The output of VDAC is not buffered. So, it is not recommended to use VDAC for driving LEDs.
PWM's duty cycle is to be varied according to the current slider position.
Use API PWM_WriteCompare(uint8/16 compare) in run time to modify the duty cycle accordingly, when the slider position changes.