In short, you will need to extract each of the colors, convert to hsl, do the customization, and then set the colors in the css gradient with the new colors, for example
$(myelement).css('background', 'linear-gradient(to bottom, '+ newColor1 +' 0%, ' + newColor2 +' 100%);
Is this what you were looking for?
source
share