Describe the solution you'd like
toGradientPaint should take a valid css gradient string and return a Figma GradientPaint object.
For example:
Input: linear-gradient(90deg, #fff, #000)
Output:
{
type: 'GRADIENT_LINEAR',
gradientStops: [
{ position: 0, color: { r: 1, g: 1, b: 1 } },
{ position: 1, color: { r: 0, g: 0, b: 0 } }
],
gradientTransform: [ [0, 1, 0], [-1, 0, 0] ]
}
And isGradientPaint should check if the input is a valid Figma GradientPaint object.