---
sourceDocument: Brazil API Reference
sourceDocumentLink: https://www.servicenow.com/docs/r/api-reference

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NowWebThemeable protocol - iOS

# NowWebThemeable protocol - iOS {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of NowWebThemeable protocol - iOS

TheNowWebThemeableprotocol allows ServiceNow customers to customize the color scheme of web pages displayed within native iOS web views hosted on their ServiceNow instances.
This enables consistent theming aligned with corporate branding or UI preferences when integrating web content into mobile applications.
Show full answer Show less  

## Key Features

* **NowWebThemeable Protocol:** Defines a required `color` property of type `NowWebColoring`, which manages color customization.
* **NowWebColoring Protocol:** Extends `NowUIColoring` and exposes default color variables usable for theming web content.
* **Custom Color Definitions:** Customers can define their own color structures implementing `NowUIColoring` to override default colors such as primary colors, alerts, backgrounds, and text colors for light themes.
* **WebTheme Structure:** Implements `NowWebThemeable` and encapsulates color properties by initializing with custom or default `WebColors`.
* **Integration:** The customized theme object can be passed to the `NowWebService.makeWebViewController` method to produce a themed native web view controller.

## Practical Application

ServiceNow customers using the Mobile SDK for iOS can create tailored web experiences inside native apps by:

* Defining a `WebColors` struct with desired color values, either using default SDK colors or fully customized ones.
* Creating a `NowWebThemeable` conforming theme struct (e.g., `CarrascoWebTheme`) that uses the color definitions.
* Instantiating the theme and passing it when creating web view controllers via `NowWebService`, ensuring the embedded web content matches the app's visual style.

This approach enhances UI consistency and branding control within hybrid mobile applications leveraging ServiceNow web content.  
The NowWebThemeable protocol provides properties that enable you to override the colors used within web pages hosted on your ServiceNow instance in a native web view.

    public protocol NowWebThemeable {
        var color: NowWebColoring { get }
    }

The [NowWebColoring](https://www.servicenow.com/docs/ohP5gaPrisYoLOvn49YfCg "The NowWebColoring protocol provides default values for the colors used within web pages hosted on your ServiceNow instance in a native web view.") protocol contains NowUIColoring. This property is used to reference default color variables that NowWebThemeable can use.

For additional information on how to theme the UI, see [Use NowUIColoring to theme NowWebTheme and NowChatTheme](https://www.servicenow.com/docs/feiEin1FnsyH2qYn~GXmFw "The NowUIColoring interface contains all the colors used by all NowSDK modules.") in the Mobile SDK Developer Guide - iOS.

## Define WebColors using default colors {#NowWebThemeableiOSProtocol__section_gkf_b13_tzb}

    /// Sample structure for using default colors that come with Mobile SDK.
    struct WebColors: NowUIColoring {
    }

## Define WebColors using custom colors {#NowWebThemeableiOSProtocol__section_ofb_j13_tzb}

    /// Use custom colors with light theme
    struct WebColors: NowUIColoring {
        private var defaultTheme: NowWebDefaultTheme { NowWebDefaultTheme(nowUITheme: NowUIDefaultTheme())
        }
        
        var brand: UIColor { lightBrand }
        var primary: UIColor { lightPrimary }
        var textPrimary: UIColor { lightTextPrimary }
        var screenHeaderText: UIColor { lightScreenHeaderText }
        var screenHeaderBackground: UIColor { lightScreenHeaderBackground }
        var textActionable: UIColor { lightTextActionable }
        var alertCritical0: UIColor { lightAlertCritical0 }
        var alertCritical3: UIColor { lightAlertCritical3 }
        var alertPositive0: UIColor { lightAlertPositive0 }
        var alertPositive3: UIColor { lightAlertPositive3 }
        var alertLow0: UIColor { lightAlertLow0 }
        var alertWarning0: UIColor { lightAlertWarning0 }
        var backgroundPrimary: UIColor { lightBackgroundPrimary }
        
        // Light Colors
        var lightBrand: UIColor { defaultTheme.color.brand }
        var lightPrimary: UIColor { defaultTheme.color.primary }
        var lightTextPrimary: UIColor { defaultTheme.color.textPrimary }
        var lightScreenHeaderText: UIColor { defaultTheme.color.screenHeaderText }
        var lightScreenHeaderBackground: UIColor { defaultTheme.color.screenHeaderBackground }
        var lightTextActionable: UIColor { defaultTheme.color.textActionble }
        var lightAlertCritical0: UIColor { defaultTheme.color.alertCritical0 }
        var lightAlertCritical3: UIColor { defaultTheme.color.alertCritical3 }
        var lightAlertPositive0: UIColor { defaultTheme.color.alertPositive0 }
        var lightAlertPositive3: UIColor { defaultTheme.color.alertPositive3 }
        var lightAlertLow0: UIColor { defaultTheme.color.alertLow0 }
        var lightAlertWarning0: UIColor { defaultTheme.color.alertWarning0 }
        var lightBackgroundPrimary: UIColor { defaultTheme.color.backgroundPrimary }
    }

## Define WebTheme structure with NowWebThemeable protocol {#NowWebThemeableiOSProtocol__section_kql_n13_tzb}

    struct CarrascoWebTheme: NowWebThemeable {
        var color: NowWebColoring
        
        struct Color: NowWebColoring {
            var nowUIColor: NowUIColoring
        
            var alertPositive0: UIColor
            var alertPositive3: UIColor
            var alertLow0: UIColor
            var alertWarning0: UIColor
            var backgroundPrimary: UIColor
            
            init(inputs: WebColors) {
                nowUIColor = ThemeColor(inputs)
                
                alertPositive0 = inputs.alertPositive0
                alertPositive3 = inputs.alertPositive3
                alertLow0 = inputs.alertLow0
                alertWarning0 = inputs.alertWarning0
                backgroundPrimary = inputs.backgroundPrimary
            }
        }
        
        public init(webColors: WebColors) {
            color = Color(inputs: webColors)
        }
    }

## Instantiate a WebTheme object by passing WebColor as input {#NowWebThemeableiOSProtocol__section_k4j_t13_tzb}

    let webTheme = CarrascoWebTheme(webColors: WebColors())

## Pass a WebTheme object to NowWebService.makeWebViewController {#NowWebThemeableiOSProtocol__section_mzl_w13_tzb}

    func webViewController(for url: URL, delegate: NowWebViewControllerDelegate) -> NowWebViewController? {
      guard let webService = webService else {
        debugPrint("Web service not initialized")
        return nil
      }
      let result = webService.makeWebViewController(for: url, delegate: delegate, theme: CarrascoWebTheme(webColors: WebColors()) )
        
      switch result {
      case .success(let viewController):
        return viewController
      case .failure(let error):
        debugPrint("Web view creation failed with error: \(error.localizedDescription)")
      }
      return nil
    }


