toAccentColor method

AccentColor toAccentColor({
  1. double darkestFactor = 0.38,
  2. double darkerFactor = 0.30,
  3. double darkFactor = 0.15,
  4. double lightFactor = 0.15,
  5. double lighterFactor = 0.30,
  6. double lightestFactor = 0.38,
})

Creates a new accent color based on this color. This provides the shades by lerping this color with Colors.black if dark or darker, and with Colors.white if light or lighter.

See also:

Implementation

AccentColor toAccentColor({
  double darkestFactor = 0.38,
  double darkerFactor = 0.30,
  double darkFactor = 0.15,
  double lightFactor = 0.15,
  double lighterFactor = 0.30,
  double lightestFactor = 0.38,
}) {
  // if (this is AccentColor) {
  //   return this as AccentColor;
  // }
  return AccentColor.swatch({
    'darkest': lerpWith(Colors.black, darkestFactor),
    'darker': lerpWith(Colors.black, darkerFactor),
    'dark': lerpWith(Colors.black, darkFactor),
    'normal': this,
    'light': lerpWith(Colors.white, lightFactor),
    'lighter': lerpWith(Colors.white, lighterFactor),
    'lightest': lerpWith(Colors.white, lightestFactor),
  });
}