https://github.com/mcluck90/win-opacity-js
Access and change the opacity of many windows on the Windows operating system
https://github.com/mcluck90/win-opacity-js
ffi nodejs opacity transparency windows
Last synced: 10 months ago
JSON representation
Access and change the opacity of many windows on the Windows operating system
- Host: GitHub
- URL: https://github.com/mcluck90/win-opacity-js
- Owner: MCluck90
- Created: 2018-05-10T20:57:29.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-11T14:24:14.000Z (about 8 years ago)
- Last Synced: 2025-05-13T20:36:01.261Z (about 1 year ago)
- Topics: ffi, nodejs, opacity, transparency, windows
- Language: JavaScript
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# win-opacity
Read and write the opacity values of windows on the Windows operating system.
## Example
```js
const winOpacity = require('win-opacity');
const windows = winOpacity.getWindows();
for (const win of windows) {
console.log(win.title); // Title on the window
const opacity = winOpacity.getOpacity(win);
// Make the window slightly more transparent
winOpacity.setOpacity(win, opacity - 10);
}
```
## Type Definitions
Definitions given in TypeScript format.
```typescript
type WindowHandle = number;
interface NativeWindow {
string title;
WindowHandle handle;
};
```
## API
- `getWindows() -> NativeWindow[]`
- Gets all visible windows
- `getOpacity(window: WindowHandle | NativeWindow) -> number`
- Returns the opacity of a window. The value will be in the range of [0-255]
- `setOpacity(window: WindowHandle | NativeWindow, opacity: number) -> void`
- Sets the opacity of a window. `opacity` must be in the range of [0-255]