Webview.SetPreferredColorScheme
-------------------------------

Sets the preferred color scheme.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Webview](component_Webview.md) | [15.5](newinversion155.md) | ❌ No | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "Webview.SetPreferredColorScheme"; WebViewerRef; Value ) 

**MBS**( **"Webview.SetPreferredColorScheme";** /\* Sets the preferred color scheme. \*/  
**$WebViewerRef**; /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/   
**$Value**) /\* The new setting.  
Pass auto, light or dark.e.g. "dark" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. |  |
| Value | The new setting.   Pass auto, light or dark. | "dark" |

### Result

Returns OK or error.

### Description

Sets the preferred color scheme.  
The PreferredColorScheme property sets the overall color scheme of the WebView2s associated with this profile.  
  
This sets the color scheme for WebView2 UI like dialogs, prompts, and menus by setting the media feature prefers-color-scheme. The default value for this is "auto", which will follow whatever color scheme the OS is currently set to.  
### See also

- [WebView.FindByName](WebViewFindByName.md)
- [Webview.GetPreferredColorScheme](WebviewGetPreferredColorScheme.md)

### Release notes

- **Version 15.5**
    - Added [Webview.GetPreferredColorScheme](https://www.mbsplugins.eu/WebviewGetPreferredColorScheme.shtml) and [Webview.SetPreferredColorScheme](https://www.mbsplugins.eu/WebviewSetPreferredColorScheme.shtml) functions for Windows.

### Blog Entries

- [New in MBS FileMaker Plugin 15.5](https://www.mbsplugins.de/archive/2025-11-25/New_in_MBS_FileMaker_Plugin_15/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 15.5pr2](https://www.mbsplugins.de/archive/2025-10-08/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 1st October 2025 , last changed 1st October 2025

  
[Webview.SetDefaultDownloadFolderPath](WebviewSetDefaultDownloadFolderPath.md) - [WinPDF.GeneratePreview](WinPDFGeneratePreview.md)

[HTML Version](WebviewSetPreferredColorScheme.shtml)