Closed Staijn1 closed 3 years ago
At least two colors are required for the gradient, that's why the original definition format.
I see, now the syntax makes sense.
I added support for that back in, but using a different method. Reason for this change is that Im using TSOA, to generate swagger documentation out of typescript type definitions. It currently does not support the format in the original file, but it does support this format.
If that method works I don't see why it shouldn't be used. It does look more readable than the original way I defined it.
@Staijn1 @alex-greff LGTM! Thank you guys!
The type definition for colorstops seemed a little strange to me. I have to admit, it worked very well and I don't fully understand how it worked, but I think it can be simplified.
A GradientColorStop object can be a string, or an object. the colorStops property in GradientOptions is always an array, filled with GradientColorStops.
So, colorStops can be filled with an array full of strings or colorStops can be filled with an array full of objects (objects have pos and color attribute)
Because I'm not entirely sure if this is correct, I'd like to ask @alex-greff, is this indeed correct?