toAccentColor method
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:
- Color.lerp
- lerpWith
- Colors.black
Color.white
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),
});
}