getBackgroundToken static method

Color getBackgroundToken(
  1. BuildContext context,
  2. OudsButtonHierarchy hierarchy
)

Implementation

static Color getBackgroundToken(BuildContext context, OudsButtonHierarchy hierarchy) {
  final theme = OudsTheme.of(context);
  final onColoredSurface = OudsTheme.isOnColoredSurfaceOf(context);
  switch (hierarchy) {
    case OudsButtonHierarchy.strong:
      return onColoredSurface ? theme.componentsTokens(context).button.colorBgStrongLoadingMono : theme.colorScheme(context).actionLoading;
    case OudsButtonHierarchy.minimal:
      return onColoredSurface ? theme.componentsTokens(context).button.colorBgMinimalLoadingMono : theme.componentsTokens(context).button.colorBgMinimalLoading;
    case OudsButtonHierarchy.negative:
      return theme.colorScheme(context).actionNegativeLoading;
    default:
      return onColoredSurface ? theme.componentsTokens(context).button.colorBgDefaultLoadingMono : theme.componentsTokens(context).button.colorBgDefaultLoading;
  }
}