getColorToken static method

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

Implementation

static Color getColorToken(BuildContext context, OudsButtonHierarchy hierarchy) {
  final theme = OudsTheme.of(context);
  final onColoredSurface = OudsTheme.isOnColoredSurfaceOf(context);
  switch (hierarchy) {
    case OudsButtonHierarchy.strong:
      return onColoredSurface ? theme.componentsTokens.button.colorContentStrongLoadingMono : theme.colorsScheme.contentOnActionLoading;
    case OudsButtonHierarchy.minimal:
      return onColoredSurface
          ? theme.componentsTokens.button.colorContentMinimalLoadingMono
          : theme.componentsTokens.button.colorContentMinimalLoading;
    case OudsButtonHierarchy.negative:
      return theme.colorsScheme.contentOnStatusEmphasizedAlt;
    default:
      return onColoredSurface
          ? theme.componentsTokens.button.colorContentDefaultLoadingMono
          : theme.componentsTokens.button.colorContentDefaultLoading;
  }
}