forRole method

({Color background, Color foreground}) forRole(
  1. PrismSemantic role
)

Background/foreground pair for a semantic role.

Implementation

({Color background, Color foreground}) forRole(PrismSemantic role) {
  switch (role) {
    case PrismSemantic.success:
      return (background: successContainer, foreground: onSuccessContainer);
    case PrismSemantic.warning:
      return (background: warningContainer, foreground: onWarningContainer);
    case PrismSemantic.error:
      return (background: errorContainer, foreground: onErrorContainer);
    case PrismSemantic.info:
      return (background: infoContainer, foreground: onInfoContainer);
  }
}