---
title: "Dark Mode for iOS PDF viewer | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/ios/customizing-the-interface/appearance-mode-manager/"
md_url: "https://www.nutrient.io/guides/ios/customizing-the-interface/appearance-mode-manager.md"
last_updated: "2026-06-09T10:25:14.488Z"
description: "Discover how to customize PDF rendering styles in Nutrient using PDFAppearanceModeManager. Change colors, themes, and more for a tailored experience."
---

# Add Dark Mode to our iOS PDF viewer

Nutrient enables you to customize PDF rendering styles (i.e. page and text colors) using [`PDFAppearanceModeManager`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfappearancemodemanager) and [`RenderOptions`](https://www.nutrient.io/api/ios/documentation/pspdfkit/renderoptions).

Night appearance mode

Changing the appearance mode will change the PDF rendering style, but it doesn’t modify the PDF on disk.

## Appearance mode

You can programmatically set the appearance mode for your [`PDFViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller)’s [`PDFAppearanceModeManager`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfappearancemodemanager) like so:

### SWIFT

```swift

let pdfController =...
pdfController.appearanceModeManager.appearanceMode =.sepia

```

### OBJECTIVE-C

```objc

PSPDFViewController *pdfController =...
pdfController.appearanceModeManager.appearanceMode = PSPDFAppearanceModeSepia;

```

The default value of the [`PDFAppearanceMode`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfappearancemode) of a [`PDFViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfviewcontroller)’s [`PDFAppearanceModeManager`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfappearancemodemanager) is the default setting, which means an empty option set.

## Allowed appearance modes

Nutrient provides [`PDFSettingsViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfsettingsviewcontroller) and `BrightnessViewController` built in to the user interface (UI) to let users change the appearance mode.

You can limit the [`allowedAppearanceModes`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfconfiguration/allowedappearancemodes) in the UI with [`PDFConfiguration`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfconfiguration) like this:

### SWIFT

```swift

let configuration = PDFConfiguration { (builder) in
    builder.allowedAppearanceModes = [.night]
}

```

### OBJECTIVE-C

```objc

PSPDFConfiguration *configuration = [PSPDFConfiguration configurationWithBuilder:^(PSPDFConfigurationBuilder *builder) {
    builder.allowedAppearanceModes = PSPDFAppearanceModeNight;
}];

```

## Color transformation

Inverting colors is a simple way to achieve night mode, as this will result in, for example, a white page background becoming black. However, since this will also change colors of text and images, some parts of the document might look odd when simply inverted. Below you’ll see the default rendering.

The image below shows simple inversion. Notice that the text and graph colors are no longer similar to their original colors.

To address this, we added another step to achieve hue-preserving night mode, which means that the colors in night mode are hues similar to the colors in the default rendering, as shown below.

When applying [`PDFAppearanceMode.night`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfappearancemode/night), this hue-preserving night mode is used, which inverts the brightness while keeping the original hue. For example, red will be mapped to pink (light red) instead of cyan.

There are separate steps for changing the document page rendering to night mode and converting a `UIColor` from normal to night mode.

### Document rendering

The most obvious aspect of the night appearance mode is that the rendering of document pages is changed from the default to the inverted hue-preserving rendering. This is done by post-processing the rendered document page image.

### UIColor

There are various parts in the UI that use a raw `UIColor`. One example of this is the color of annotations during drawing when the annotations aren’t yet rendered on the page. In hue-preserving night mode, these colors are adjusted, similar to how changes are applied for document rendering, and this results in the same hue-preserving night mode color for all shown content.

Adapting `UIColor` has to be done in addition to document page rendering. This is because the rendering of existing annotations on the document page and the rendering of annotations while they’re being created use different code paths, and both paths require the same color transformation applied in slightly different ways.

### Disable preserving hues

If you’d rather night mode used a straightforward color inversion without preserving hues, you can use [`AppearanceModeManagerDelegate`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/appearancemodemanagerdelegate):

```swift

pdfViewController.appearanceModeManager.delegate = self

```

Then implement [`appearanceManager(_:renderOptionsFor:)`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/appearancemodemanagerdelegate/appearancemanager(_:renderoptionsfor:)) in your delegate to not include `.colorCorrectInverted` for the `.night` mode:

```swift

func appearanceManager(_ manager: PDFAppearanceModeManager, renderOptionsFor mode: PDFAppearanceMode) -> RenderOptions {
    let options = RenderOptions()

    if mode.contains(.night) {
        options.invertRenderColor = true
        // Don’t set `options.filters =.colorCorrectInverted` so the hues are not preserved.
    }

    if mode.contains(.sepia) {
        options.filters =.sepia
    }

    return options
}

```

## Dark rendering without using appearance mode

[`PDFAppearanceModeManager`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/pdfappearancemodemanager) is a higher-level API built on top of [`RenderOptions`](https://www.nutrient.io/api/ios/documentation/pspdfkit/renderoptions). You can set up the same night rendering without using the appearance mode manager like this:

```swift

document.updateRenderOptions(for:.all) { renderOptions in
    renderOptions.invertRenderColor = true
    renderOptions.filters =.colorCorrectInverted
}

```

If you’d like fine-grained control, you can use the [`additionalCIFilters`](https://www.nutrient.io/api/ios/documentation/pspdfkit/renderoptions/additionalcifilters) property of `RenderOptions` to perform your own color adjustments. Applying additional filters to annotations isn’t currently supported.
---

## Related pages

- [Open multiple windows in our iOS viewer](/guides/ios/features/multiple-windows.md)
- [Optimize your PDF reading with Reader View](/guides/ios/features/reader-view.md)
- [RTL support in our iOS viewer](/guides/ios/miscellaneous/page-bindings.md)

