getModifiers method
Gets the modifiers at (x, y). Returns transparent if coordinates are out of bounds.
Implementation
int getModifiers(int x, int y) {
if (x < 0 || x >= width || y < 0 || y >= height) {
return Modifier.transparent;
}
return attributes[(y * width + x) * 3 + 2];
}