gradient-parser icon indicating copy to clipboard operation
gradient-parser copied to clipboard

get start/end value

Open fukemy opened this issue 3 years ago • 0 comments

Hi, first i want to say I LOVE U, this lib is really useful to me I can get colors and locations, now i want to get start/end value. Can u help? Sample:

linear-gradient(180deg, rgba(112, 201, 47, 1) 25%, rgba(248, 202, 0, 1) 50%, rgba(189, 21, 80, 1) 75%)
const colors = gradient[0].colorStops.map((c) => {
 const t = c.value
                return `rgba(${t[0]}, ${t[1]}, ${t[2]}, ${[3]})`
            })
           
 const locations = gradient[0].colorStops.map((c) => {
                const l = c.length.value
                return l/100
            })

            

fukemy avatar May 27 '22 05:05 fukemy