LinearColorSwatch constructor

LinearColorSwatch(
  1. Color? _base, {
  2. double factor = 0.01,
  3. SwatchConfig swatchConfig = SwatchConfig.lighter,
  4. DyteColorSwatch? colorSwatch,
})

factor decides the percentage by which the colors will be generated for the swatch.

Implementation

LinearColorSwatch(
  this._base, {
  double factor = 0.01,
  SwatchConfig swatchConfig = SwatchConfig.lighter,
  this.colorSwatch,
})  : assert(factor >= 0 && factor <= 1),
      assert(!(_base == null && colorSwatch == null),
          'base color or colorSwatch is required'),
      _config = swatchConfig,
      _factor = factor;