0.1.0 • Published 4 years ago
electron-vibrancy-windows v0.1.0
Electron Vibrancy for Windows
This module uses native API calls to achieve the blur effect on an Electron app.

Installation
You will need Python, Visual Studio or Visual C++ build tools to install this. An easy way to install them can be found here.
yarn add DrunkWinter/electron-vibrancy-windowsor
npm install DrunkWinter/electron-vibrancy-windowsImportant
Don't forget to specify a transparent backgroundColor!
{ backgroundColor: '#00000000' } Although it might work, it is not recommended using this module on a machine older than Windows 10.
How to use
const vibrancy = require('electron-vibrancy');
function createWindow() {
// Create the browser window.
const mainWindow = new BrowserWindow({
title: 'My App',
width: 1200,
height: 760,
frame: false,
backgroundColor: '#00000000',
webPreferences: {
nodeIntegration: true
}
});
vibrancy.EnableVibrancy(mainWindow);
mainWindow.loadFile(path.join(__dirname, 'index.html'));
};
app.on('ready', createWindow);API
EnableVibrancy(window)
Returns Integer.
windowBrowserWindowinstance
DisableVibrancy(window)
Returns Integer. Disables Vibrancy.
windowBrowserWindowinstance
Platform notices
The addon uses SetWindowCompositionAttribute, which is an undocumented Windows API, which means it can be changed by Microsoft any time and break the functionality.
License
This project is under MIT. See LICENSE