# Stylize in app messages

If you want to specify fonts and colors of the messages displayed you can use the `MBInAppMessageViewStyleDelegate` protocol. All the functions of the protocol are optional, if a function is not implemented the framework will use a default value. The elements that can be stylized are the following:

* **backgroundStyle**: can be a solid color or a translucent color
* **backgroundColor**: the color of the background
* **titleColor**: the text color for the title of the message
* **bodyColor**: the text color for the body
* **closeButtonColor**: the color of the close button
* **button1BackgroundColor**: the background color of the first action button
* **button1TitleColor**: the text color of the first action button
* **button2BackgroundColor**: the background color of the second action button
* **button2TitleColor**: the text color of the second action button
* **button2BorderColor**: the border color of the second action button
* **titleFont**: the font of the title
* **bodyFont**: the font of the body
* **buttonsTextFont**: the font of the buttons titles

Example:

```swift
func backgroundStyle(forMessage message: MBInAppMessage) -> MBInAppMessageViewBackgroundStyle {
    return .solid
}

func backgroundColor(forMessage message: MBInAppMessage) -> UIColor {
    return .green
}

func titleColor(forMessage message: MBInAppMessage) -> UIColor {
    return .blue
}

func bodyColor(forMessage message: MBInAppMessage) -> UIColor {
    return .darkText
}

func button1TitleColor(forMessage message: MBInAppMessage) -> UIColor {
    return .white
}

func button1BackgroundColor(forMessage message: MBInAppMessage) -> UIColor {
    return .cyan
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ep.mburger.cloud/ios-docs/messages/stylize-in-app-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
