PrimitiveGradient.from constructor

PrimitiveGradient.from(
  1. Gradient gradient
)

Dissolve a Gradient into a PrimitiveGradient.

Borrows the provided Gradient.colors but feeds the (potentially null) List<double> Gradient.stops into the method interpretStops.

If this passed gradient has explicitly-constructed stops, they are returned unfettered. Otherwise an evenly-distributed list of implied stops is generated considering the Gradient type and the list of colors.

Implementation

factory PrimitiveGradient.from(Gradient gradient) =>
    PrimitiveGradient._(gradient.colors, interpretStops(gradient));