tintedPressed static method

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

Returns the FCS opinionated tinted splash 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 tintedPressed(Color overlay, Color tint, [double factor = 1]) {
  // Starting kAlphaPressed 0x1F = 31 = 12.16%, same as M3 opacity on pressed.
  final int usedAlpha = (kAlphaPressed * factor).round().clamp(0x00, 0xFF);
  // Tint color alpha blend into overlay kTintPressed 0xA5 = 165 = 65%
  return overlay.blendAlpha(tint, kTintPressed).withAlpha(usedAlpha);
}