toMessageBoxColorType method

MessageBoxColorType toMessageBoxColorType()

Convert from a SDL_MessageBoxColorType member.

Implementation

MessageBoxColorType toMessageBoxColorType() {
  switch (this) {
    case SDL_MessageBoxColorType.SDL_MESSAGEBOX_COLOR_BACKGROUND:
      return MessageBoxColorType.background;
    case SDL_MessageBoxColorType.SDL_MESSAGEBOX_COLOR_TEXT:
      return MessageBoxColorType.text;
    case SDL_MessageBoxColorType.SDL_MESSAGEBOX_COLOR_BUTTON_BORDER:
      return MessageBoxColorType.buttonBorder;
    case SDL_MessageBoxColorType.SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND:
      return MessageBoxColorType.buttonBackground;
    case SDL_MessageBoxColorType.SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED:
      return MessageBoxColorType.buttonSelected;
    case SDL_MessageBoxColorType.SDL_MESSAGEBOX_COLOR_MAX:
      return MessageBoxColorType.max;
    default:
      throw SdlError(
        this,
        'Unrecognised `SDL_MessageBoxColorType` member.',
      );
  }
}