# Dark mode

Control whether surveys and messages render in their light or dark look, or let Screeb follow your app.

Surveys and messages follow the dark mode of your app. In dark mode they draw the dark values of their theme. A theme without dark values stays light. You set the dark values in the theme editor of the Screeb admin. Dark mode requires the iOS or Android SDK release that adds it.

## Automatic detection

By default the color scheme is `"auto"`.

The SDK reports the appearance of your app: the device setting, or the override your app sets itself. Surveys and messages follow it live, so they switch when the visitor changes the device setting or your app changes its own appearance. Most apps need no code.

The override is `overrideUserInterfaceStyle` on your window or view controller.

## Force a color scheme

Pass `colorScheme` in the init options to force `"light"` or `"dark"` from the start. It overrides the appearance of your app.

```swift
Screeb.initSdk(
    context: nil,
    channelId: "<YOUR-CHANNEL-ID>",
    initOptions: InitOptions(colorScheme: "dark")
)
```

## Change it at runtime

Call `setColorScheme` with `"light"`, `"dark"` or `"auto"`. The call overrides the `colorScheme` init option. Pass `"auto"` to follow the appearance of your app again.

```swift
Screeb.setColorScheme("dark")
```
