How to detect transparency or colour on a mask?

Maybe this will be usefull for you