gradient-parser
gradient-parser copied to clipboard
get start/end value
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
})