fancy-acrylic
v1.0.0
Published
Native addon for applying acrylic effects to Windows windows
Maintainers
Readme
fancy-acrylic
A Node.js native addon for applying acrylic and blur effects to Windows windows using window handles.
Features
- Apply acrylic or blur effects to any window using its handle (HWND)
- Customize corner styles (none, round, roundsmall)
- Set opacity and tint colors
- Set border colors on Windows 11+
- Cross-platform compatibility (Windows only for effects)
Installation
npm install
npm run buildRequirements
- Windows 10 or later
- Node.js with native module support
- Visual Studio Build Tools (for compilation)
Usage
const { applyEffect, isSupported, getWindowsBuildNumber } = require('./index.js');
// Check if acrylic effects are supported
console.log('Supported:', isSupported());
// Get Windows build number
console.log('Build:', getWindowsBuildNumber());
// Apply acrylic effect
const result = applyEffect({
hwnd: 0x12345678, // Window handle as number
type: 'acrylic', // 'blur' or 'acrylic'
corner: 'round', // 'none', 'round', or 'roundsmall'
opacity: 200, // 0-255
tintColor: 'FF0000', // Optional: hex color (RRGGBB)
borderColor: '00FF00' // Optional: hex color (RRGGBB)
});API
applyEffect(options)
Applies acrylic or blur effect to a window.
Parameters:
options(Object): Configuration optionshwnd(number): Window handle (HWND as number) - requiredtype(string): Effect type -'blur'or'acrylic'(default:'acrylic')corner(string): Corner style -'none','round', or'roundsmall'(default:'none')opacity(number): Opacity value 0-255 (default: 204)tintColor(string): Tint color in hex format (RRGGBB) - optionalborderColor(string): Border color in hex format (RRGGBB) - optional
Returns: boolean - true if successful
Example:
applyEffect({
hwnd: windowHandle,
type: 'acrylic',
corner: 'round',
opacity: 180,
tintColor: '0078D4',
borderColor: 'FF6B6B'
});isSupported()
Checks if acrylic effects are supported on the current system.
Returns: boolean - true if supported
getWindowsBuildNumber()
Gets the current Windows build number.
Returns: number - Windows build number, or 0 if not Windows
Getting Window Handles
To use this addon, you need to obtain window handles (HWND). You can:
- Use other native modules that provide window enumeration
- Use the Windows API from other languages
- Use tools like
FindWindoworEnumWindowsfrom the Windows API
Notes
- tintColor and borderColor are optional: If not provided, no color will be applied
- Border is always visible: The addon doesn't provide functionality to hide borders
- Windows 11+ for border colors: Border color setting only works on Windows 11 and later
- Windows 10+ required: Acrylic effects require Windows 10 or later
Error Handling
The addon throws JavaScript errors for:
- Invalid parameters
- Invalid window handles
- Unsupported operations
- System API failures
Building
# Install dependencies
npm install
# Build the native addon
npm run build
# Or use node-gyp directly
npx node-gyp configure
npx node-gyp buildLicense
MIT License
