Is there a way to use Linear gradient along with HSLA?

Im trying to set my background colour based off a formula and HSLA but i want to use it as a Linear gradient.This is what i have, but returns no colour

document.body.style.backgroundColor = `linear-gradient(179.31deg, 180,50%,${lightness}%) 9.28%, #F4AC4E 167.45%)`;

21 thoughts on “Is there a way to use Linear gradient along with HSLA?”

  1. Would be easier, and i mean soooo much easier, if you used css gradient instead of javascript gradient tools or whatever.

    such as something cool like this

    html{
    background: rgb(2,0,36);
    background: linear-gradient(90deg, rgba(2,0,36,1) 1%, rgba(9,121,114,1) 31%, rgba(0,212,255,1) 63%);
    }
    p{
    color:white;
    }
    <html>
    <p>Hello there, I'm Lorem</p>
    </html>

    You can use this website for all your gradient needs

    Reply

Leave a Comment