tintedHovered static method

Color tintedHovered(
  1. Color overlay,
  2. Color tint, [
  3. double factor = 1
])

Returns the FCS opinionated tinted hover color on an overlay color.

Typically the primary color is the color used as tint base. The tint effect is different for light and dark mode.

Implementation

static Color tintedHovered(Color overlay, Color tint, [double factor = 1]) {
  // Starting kAlphaHover 0x14=20=8%, same as M3 opacity on hover.
  final int usedAlpha = (kAlphaHovered * factor).round().clamp(0x00, 0xFF);
  // Tint color alpha blend into overlay kTintHover  0x99=153= 60%
  return overlay.blendAlpha(tint, kTintHover).withAlpha(usedAlpha);
}