getHoverColor method

Color? getHoverColor(
  1. BuildContext context, {
  2. FastButtonEmphasis? emphasis,
  3. Color? hoverColor,
  4. Color? color,
  5. Widget? icon,
})

Implementation

Color? getHoverColor(
  BuildContext context, {
  FastButtonEmphasis? emphasis,
  Color? hoverColor,
  Color? color,
  Widget? icon,
}) {
  if (hoverColor != null) return hoverColor;
  if (color != null) return color.withAlpha(kFastButtonHoverAlpha);

  if ((icon is FaIcon) && icon.color != null) {
    return icon.color!.withAlpha(kFastButtonHoverAlpha);
  }

  if ((icon is Icon) && icon.color != null) {
    return icon.color!.withAlpha(kFastButtonHoverAlpha);
  }

  return getEmphasisedColor(context, emphasis: emphasis)
      ?.withAlpha(kFastButtonHoverAlpha);
}