getHighlightColor method

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

Implementation

Color? getHighlightColor(
  BuildContext context, {
  FastButtonEmphasis? emphasis,
  Color? highlightColor,
  Color? color,
  Widget? icon,
}) {
  if (highlightColor != null) return highlightColor;

  if (color != null) {
    return color.withAlpha(kFastButtonHighlightAlpha);
  }

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

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

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