Answer the question
In order to leave comments, you need to log in
How do I convert a CSS gradient (as a string) to a javascript object?
Hi all.
I'm asking for help.
The task is this:
you need to fill the SVG path elements with a gradient.
I get the color of the gradient as a string:
linear-gradient(49.59deg, #165953 -40.47%, rgba(22, 89, 83, 0.24) 98.51%)
{
angle: "rotate(49.59)",
stop_1: {
color: "#165953",
offset: "-40.47%",
},
stop_2: {
color: "rgba(22, 89, 83, 0.24)",
offset: "98.51%",
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question