ColorRamp.fromColors constructor

ColorRamp.fromColors({
  1. required List<Color> colors,
  2. required int size,
})

Creates a custom color ramp with a linear gradient between the provided colors.

The alpha channel of each color is ignored, so every color is treated as if it were completely opaque.

Parameters:

  • colors — A list of two or more colors that the color ramp will blend between.
  • size — The number of steps in the complete resulting gradient. A typical value is 256.