---
sourceDocument: Referência de API do Brasil
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/api-reference

 Release :

    - brazil

ft:locale :

    - pt-BR

ft:publication_title :

    - Referência de API do Brasil

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Protocolo NowWebThemeable - iOS

# Protocolo NowWebThemeable - iOS {#ariaid-title1}

Versão de lançamento: Brazil  
Atualizado 10 de set. de 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 min. de leitura  
O protocolo NowWebThemeable fornece propriedades que permitem substituir as cores usadas nas páginas da web hospedadas ServiceNow em sua instância em uma exibição da web nativa.

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

O [Protocolo do NowWebColoring - iOS](https://servicenow-prod.fluidtopics.net/VZugym4ZLOA~7uLN5kypTA "O protocolo NowWebColoring fornece valores padrão para as cores usadas em páginas da web hospedadas em sua ServiceNow instância em uma exibição da web nativa.") protocolo NowWebColoring contém NowUIColoring. Esta propriedade é usada para fazer referência a variáveis de cor padrão que o NowWebThemeable pode usar.

Para obter informações adicionais sobre como criar o tema da IU, consulte [Use o NowUIColoring para o tema NowWebTheme e NowChatTheme](https://servicenow-prod.fluidtopics.net/eSh~yP_I6azhTlrwyFPqZw "A interface do NowUIColoring contém todas as cores usadas por todos os módulos do NowSDK.") no Guia do desenvolvedor do SDK para celular - iOS.

## Defina WebColors usando cores padrão {#NowWebThemeableiOSProtocol__section_gkf_b13_tzb}

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

## Defina WebColors usando cores personalizadas {#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 }
    }

## Defina a estrutura do WebTema com o protocolo NowWebThemeable {#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)
        }
    }

## Para instanciar um objeto WebTema passando WebColor como entrada {#NowWebThemeableiOSProtocol__section_k4j_t13_tzb}

    let webTheme = CarrascoWebTheme(webColors: WebColors())

## Passar um objeto WebTema para 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
    }


