You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specs/APIReview_BackgroundColor.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ WebView2 developers have provided feedback that there is a 'white flicker' when
3
3
4
4
5
5
# Description
6
-
The `BackgroundColor` property allows developers to set the color that shows before WebView loads any web content - the default is white. This API uses the `CoreWebView2Color` value which is used to specify an RGBA color. Important to note is the A value which allows developers to set transparency. Semi-transparent colors are not currently supported, but the work is pending. The `BackgroundColor` property enables a seamless UI experience. Developers can choose a color to show between loading pages that matches the scheme of the hosting application. Or do away with the color entirely and just show the hosting app's content.
6
+
The `BackgroundColor` property allows developers to set the color that shows before WebView loads any web content. The default color is white. This API uses the `COREWEBVIEW2_COLOR` value which is used to specify an RGBA color. The 4 fields of `COREWEBVIEW2_COLOR` have intensity values from 0 to 255 with 0 being the least intense. Important to note is the A value which allows developers to set transparency. An alpha value of 0 is entirely transparent and 255 is opaque. Semi-transparent colors are not currently supported, but the work is pending. The `BackgroundColor` property enables a seamless UI experience. Developers can choose a color to show between loading pages that matches the color scheme of the hosting application. Or do away with the color entirely and just show the hosting app's content.
7
7
8
8
# Examples
9
9
The fields of CoreWebView2Color can be set with plain old integer values between 0 and 255. In the following example, we see the app reading color values from a COLORREF (which are integers under the covers) into a CoreWebView2Color. It then sets the CoreWebView2Color.A value to 0 or 255. Once the CoreWebView2Color value is filled out, it is passed to the controller's put_BackgroundColor API.
0 commit comments