Here is some code
function HSLtoRGB(hue, saturation, light){
let r,g,b;
let c = (1-Math.abs(2*light -1))*saturation;
let h = hue/60;
let x = c*(1-Math.abs(h %2 -1))
let m = light - 1/2 * c ;
if( h < 1) {
r = c; g = x; b = 0;
} else if (h < 2) {
r = x; g = c; b = 0;
} else if (h < 3) {
r = 0; g = c; b = x;
} else if (h < 4) {
r = 0; g = x; b = c;
} else if (h < 5) {
r = x; g = 0; b = c;
} else {
r = c; g = 0; b = x;
}
r = Math.floor((m+r) * 255);
g = Math.floor((m+g) * 255);
b = Math.floor((m+b) * 255);
return "rgb(" + r + "," + g + "," + b + ")";
}