Skip to content

Commit 978aeef

Browse files
committed
(#6) Added thresholding for opacity values
1 parent efdb798 commit 978aeef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ function bitmap(width, height, byteWidth, bitsPerPixel, bytesPerPixel, image) {
1717
};
1818
}
1919

20-
module.exports.screen.highlight = libnut.highlight;
20+
module.exports.screen.highlight = function(x, y, width, height, duration, opacity) {
21+
let highlightOpacity = (opacity < 0) ? 0 : opacity;
22+
highlightOpacity = (highlightOpacity > 1) ? 1 : highlightOpacity;
23+
24+
libnut.highlight(x, y, width, height, duration, highlightOpacity);
25+
}
2126

2227
module.exports.screen.capture = function(x, y, width, height) {
2328
//If coords have been passed, use them.

0 commit comments

Comments
 (0)