In a Canvas in the onpaint() function:
ctx.strokeStyle = 'hsl(255, 100%, 50%)';
console.log("before = " + ctx.strokeStyle);
ctx.strokeStyle = 'hsl(320, 100%, 50%)';
console.log("after = " + ctx.strokeStyle)
You will notice you get the same #hex color out of it.