Added back eyedropper

This commit is contained in:
unsettledgames
2021-11-01 11:33:18 +01:00
parent d034bbc659
commit 32fb4ca943
9 changed files with 129 additions and 15 deletions

View File

@@ -1,6 +1,23 @@
// Acts as a public static class
class Util {
/** Tells if a pixel is empty (has alpha = 0)
*
* @param {*} pixel
*/
static isPixelEmpty(pixel) {
if (pixel == null || pixel === undefined) {
return false;
}
// If the alpha channel is 0, the current pixel is empty
if (pixel[3] == 0) {
return true;
}
return false;
}
/** Tells if element is a child of an element with class className
*
* @param {*} element