getIconColor static method

Color getIconColor(
  1. BuildContext context,
  2. OudsButtonControlState states,
  3. OudsButtonHierarchy hierarchy
)

Static method to get the icon color based on button state, hierarchy.

Implementation

static Color getIconColor(BuildContext context, OudsButtonControlState states, OudsButtonHierarchy hierarchy) {
  // Determine icon color based on the current control state.
  switch (states) {
    case OudsButtonControlState.enabled:
      return _getEnabledIconColor(context, hierarchy);
    case OudsButtonControlState.hovered:
      return _getHoverIconColor(context, hierarchy);
    case OudsButtonControlState.pressed:
      return _getPressedIconColor(context, hierarchy);
    case OudsButtonControlState.disabled:
      return _getDisabledIconColor(context, hierarchy);
    case OudsButtonControlState.loading:
      return OudsButtonLoadingModifier.getColorToken(context, hierarchy);
  }
}