finalize HSL conversion code