windows-caption-color
It's a node extension to get the caption color of an active windows in Windows 8+. In non-Windows, it will always return false.
Installion
npm install windows-caption-color --save
Requirement
Node 0.12+ / Electron / nwjs 0.12+
Example
;
Will return:
"dwm": "hsv": "c73eb8d0" "opaque": true "a": 078 "r": 62 "g": 184 "b": 208 "reg": "hsv": "af4adbf8" "balance": 4 "a": 069 "r": 74 "g": 219 "b": 248
dwm
is from DwmGetColorizationColor
API, description: https://msdn.microsoft.com/en-us/library/windows/desktop/aa969513(v=vs.85).aspx.
reg
is from HKCU\Software\Microsoft\Windows\DWM
.
However, the result from GetSysColor(COLOR_ACTIVECAPTION)
is wrong.
Example
In Windows 10, the following code can set your document.body
's background color same as the caption color.
;
And, screenshots here.
Windows 10
Windows 8.1
Windows 7
Why?
If you want to use it directly, you will get a wrong result. And you have to refer to the following article.
http://stackoverflow.com/questions/24555827/how-to-get-title-bar-color-of-wpf-window-in-windows-8-1
http://stackoverflow.com/questions/3560890/vista-7-how-to-get-glass-color
License
The MIT License