octalmage / robotjs

Node.js Desktop Automation.
http://robotjs.io
MIT License
12.34k stars 955 forks source link

colorAt never functioning #721

Open TesDevelopment opened 2 years ago

TesDevelopment commented 2 years ago

Writing a function to quickly get the colors of a line 1 pixel long 40 pixels wide. No coordinates work when entered into the colorAt function.

Error: Requested coordinates are outside the main screen's dimensions.

(I have two monitors but have tested with one turned off and received the same results)

Expected Behavior

An array should be built containing all color values in the previously mentioned line.

Current Behavior

The following error is spouted.

Error: Requested coordinates are outside the main screen's dimensions.

Steps to Reproduce (for bugs)

1.Take a screenshot of any width and length 2.Attempt to use the colorAt function

Context

`

        const array_load = await screen.capture(710 - (i * 67), 80, 40, 1);
        let pixel_array = [];
        for(let i = 0; i < 40; i++){
            pixel_array.push(array_load.colorAt(i, 1))
        }

`

Your Environment