isValidGradient static method
Used when finalizing a gradient to send with PUT or POST.
For a less strict test, used to validate a gradient while still working with it, see isValidGradientDraft.
Returns true
if:
points
isnull
points
is emptypoints
has 2 to 5 (inclusive) elements
Implementation
static bool isValidGradient(List<LightColorXy>? points) =>
points == null ||
points.isEmpty ||
(points.length >= 2 && points.length <= 5);