How does js get the color of a coordinate point on the page?

recently, I have been trying to take a screenshot of a web page. I have an idea that
js can get the color of a coordinate point on the page , similar to the color picker , or the screenshot tool .
canvas can get the color of a coordinate in the area. Does the web page store pixel information like canvas ?
html2canvas plug-in can parse the dom that exists on the page into canvas, but after testing, the effect is not very ideal. After all, the support for style is limited, and it is easy to encounter style disorder.


if you want to achieve pixel-level control, the first thing that comes to mind is canvas. Canavs has a convenient off-the-shelf api.

if you have to use native, you can consider getting the element based on the coordinates, then getting the element's calculated attributes, and then finding the color.


you can use nodejs to write a service that recognizes the color of the picture. Then use canvas to intercept where the mouse is located. Upload to nodejs to get colors?

Menu