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
* Options are listed in [SkParseColor.cpp](https://source.chromium.org/chromium/chromium/src/+/main:third_party/skia/src/utils/SkParseColor.cpp;l=11-152;drc=eea4bf52cb0d55e2a39c828b017c80a5ee054148)
97
+
* Similar to CSS Color Module Level 3 keywords, but case-sensitive.
98
+
* e.g. `blueviolet` or `red`
99
+
100
+
**Note:** Hex format with alpha takes `AARRGGBB` or `ARGB`, _not_`RRGGBBA` or `RGA`.
Note that even for apps that use `ready-to-show` event, it is still recommended
67
67
to set `backgroundColor` to make app feel more native.
68
68
69
+
Some examples of valid `backgroundColor` values include:
70
+
71
+
```js
72
+
constwin=newBrowserWindow()
73
+
win.setBackgroundColor('hsl(230, 100%, 50%)')
74
+
win.setBackgroundColor('rgb(255, 145, 145)')
75
+
win.setBackgroundColor('#ff00a3')
76
+
win.setBackgroundColor('blueviolet')
77
+
```
78
+
79
+
For more information about these color types see valid options in [win.setBackgroundColor](browser-window.md#winsetbackgroundcolorbackgroundcolor).
80
+
69
81
## Parent and child windows
70
82
71
83
By using `parent` option, you can create child windows:
@@ -199,9 +211,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
199
211
*`enableLargerThanScreen` boolean (optional) - Enable the window to be resized larger
200
212
than screen. Only relevant for macOS, as other OSes allow
201
213
larger-than-screen windows by default. Default is `false`.
202
-
*`backgroundColor` string (optional) - Window's background color as a hexadecimal value,
203
-
like `#66CD00` or `#FFF` or `#80FFFFFF` (alpha in #AARRGGBB format is supported if
204
-
`transparent` is set to `true`). Default is `#FFF` (white).
214
+
*`backgroundColor` string (optional) - The window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color format. Alpha in #AARRGGBB format is supported if `transparent` is set to `true`. Default is `#FFF` (white). See [win.setBackgroundColor](browser-window.md#winsetbackgroundcolorbackgroundcolor) for more information.
205
215
*`hasShadow` boolean (optional) - Whether window should have a shadow. Default is `true`.
206
216
*`opacity` number (optional) - Set the initial opacity of the window, between 0.0 (fully
207
217
transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.
@@ -992,12 +1002,33 @@ APIs like `win.setSize`.
992
1002
993
1003
#### `win.setBackgroundColor(backgroundColor)`
994
1004
995
-
*`backgroundColor` string - Window's background color as a hexadecimal value,
996
-
like `#66CD00` or `#FFF` or `#80FFFFFF` (alpha is supported if `transparent`
997
-
is `true`). Default is `#FFF` (white).
998
-
999
-
Sets the background color of the window. See [Setting
* Options are listed in [SkParseColor.cpp](https://source.chromium.org/chromium/chromium/src/+/main:third_party/skia/src/utils/SkParseColor.cpp;l=11-152;drc=eea4bf52cb0d55e2a39c828b017c80a5ee054148)
1028
+
* Similar to CSS Color Module Level 3 keywords, but case-sensitive.
1029
+
* e.g. `blueviolet` or `red`
1030
+
1031
+
Sets the background color of the window. See [Setting `backgroundColor`](#setting-the-backgroundcolor-property).
0 commit comments