Is there any way to detect what the color of a pixel is (or the index # of the palette) when clicking on a view? I have several views that are very large and irregularly shaped and I'd like it so that the view only responds to a click when that click isn't on a transparent portion of it.
IsItSkip kernel function detects whether a pixel in a cel is transparent. Usage something like:
(if (IsItSkip (view loop cel (- (event x?) (candidate nsLeft?)) (- (event y?) (candidate nsTop?))) ...then...)
(more code/checks are needed to avoid garbage results)
This code gets the x and y of the event being processed from an event variable, and the top/left corner of the view you're testing against. IsItSkip returns a simple TRUE if the pixel is transparent, FALSE otherwise.
This unfortunately will only work on the skip (transparent) color and not other colors.
Requires the LSL6 interpreter.