---
sourceDocument: オーストラリア API リファレンス
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/api-reference

 Release :

    - australia

ft:locale :

    - ja-JP

ft:publication_title :

    - オーストラリア API リファレンス

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NowUIColoring を使用して NowWebTheme と NowChatTheme をテーマにする

# NowUIColoring を使用して NowWebTheme と NowChatTheme をテーマにする {#ariaid-title1}

* リリースバージョン: Australia
* 
* 更新日 2026年03月12日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：3分

NowUIColoring インターフェイスには、すべての NowSDK モジュールで使用されるすべての色が含まれています。
複数の SDK モジュール間で同様の色変数を使用するシナリオでは、 NowUIColoring インターフェイスを実装できます。このインターフェイスを使用すると、色の値をオーバーライドし、その実装を使用して、テーマクラス [NowWebTheme](https://servicenow-prod.fluidtopics.net/n1Q4jc3aF6OuKn2ea3BplQ "NowWebTheme インターフェイスには、ネイティブ Web ビューの ServiceNow インスタンスでホストされている Web ページ内で使用される色を上書きできるプロパティが用意されています。") および [NowChatTheme](https://servicenow-prod.fluidtopics.net/qWozzfe4qumWrHePKTCgag "NowChatTheme インターフェイスは、ライブエージェントおよび仮想エージェントチャット UI の要素のデフォルトの色を定義します。") 内の nowUIColoring 値をオーバーライドできます。色変数が上書きされない場合、 NowUIColoring インターフェイスはデフォルトの色を使用します。

次のコード例は、Web UI とチャット UI の両方の色をオーバーライドする方法を示しています。

    // Implement the NowUIColoring and override desired color variables
    val nowUIColoringImpl = object : NowUIColoring {
        override val brand: Int
            get() = Color.BLUE

        override val textPrimary: Int
            get() = Color.WHITE

        //override the rest of color variables

    }

    // Override the nowUIColoring for NowWeb value using the NowUIColoring implementation
    lifecycleScope.launch {
        sdkManager.getNowWebService()?.launch(activity, URL("https://instance-name.service-now.com"), object : NowWebTheme {
            override val nowUIColoring: NowUIColoring
                get() = nowUIColoringImpl
        })
    }

    //Override the nowUIColoring for NowChat value using the NowUIColoring implementation
    lifecycleScope.launch {
        sdkManager.getNowChatService()?.start(activity, object : NowChatTheme {
            override val nowUIColoring: NowUIColoring
                get() = nowUIColoringImpl
        })
    }

## ダークテーマのサポート {#mobsdk-and-color-theming__section_qxq_4rc_y2c}

NowChat でダークテーマをサポートするには、NowChatTheme の独自のダークテーマ実装を提供し、 それを NowChatService.start() 関数と NowChatService.updateTheme() 関数で使用します。または、デフォルトのダークテーマカラーで NowChatTheme インターフェイスを実装する NowChatThemeDark クラスを使用することもできます。このクラスは、カスタムダークテーマ実装のベースとして使用することもできます。

    val chatService = serviceManager.getNowChatService()

    val chatThemeLight = object : NowChatTheme {
        override val backgroundPrimary: Int
            get() = Color.WHITE

        override val textPrimary: Int
            get() = Color.BLACK

        // Override remaining theme colors
    }

    //create dark theme using the NowChatThemeDark class
    val chatThemeDark = object : NowChatThemeDark(){
        override val backgroundPrimary: Int
            get() = Color.BLACK

        override val textPrimary: Int
            get() = Color.WHITE

        // Override remaining theme colors
    }

    //start NowChat with light theme
    chatService?.start(activity, chatThemeLight)


    //update NowChat theme to dark theme
    chatService?.updateTheme(chatThemeDark)


