Update docs
This commit is contained in:
parent
5dd5dbb3d8
commit
c0f8b4895d
1 changed files with 26 additions and 0 deletions
|
@ -7,6 +7,19 @@ const {systemPreferences} = require('electron')
|
||||||
console.log(systemPreferences.isDarkMode())
|
console.log(systemPreferences.isDarkMode())
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Events
|
||||||
|
|
||||||
|
The `systemPreferences` object emits the following events:
|
||||||
|
|
||||||
|
### Event: 'accent-color-changed' _Windows_
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
* `event` Event
|
||||||
|
* `newColor` String - The new RGBA color the user assigned to be there system
|
||||||
|
accent color.
|
||||||
|
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
### `systemPreferences.isDarkMode()` _macOS_
|
### `systemPreferences.isDarkMode()` _macOS_
|
||||||
|
@ -124,3 +137,16 @@ if (browserOptions.transparent) {
|
||||||
```
|
```
|
||||||
|
|
||||||
[dwm-composition]:https://msdn.microsoft.com/en-us/library/windows/desktop/aa969540.aspx
|
[dwm-composition]:https://msdn.microsoft.com/en-us/library/windows/desktop/aa969540.aspx
|
||||||
|
|
||||||
|
### `SystemPreferences.getAccentColor()` _Windows_
|
||||||
|
|
||||||
|
Returns the users current system wide color preference in the form of an RGBA
|
||||||
|
hexadecimal string.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const color = app.getSystemAccentColor() // `"aabbccdd"`
|
||||||
|
const red = color.substr(0, 2) // "aa"
|
||||||
|
const green = color.substr(2, 2) // "bb"
|
||||||
|
const blue = color.substr(4, 2) // "cc"
|
||||||
|
const alpha = color.substr(6, 2) // "dd"
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue