used 16bit pwm and logarithmic table to correct colour brightness