Name
IsBrushEmpty -- check if a brush has only invisible pixels (V8.0)
Synopsis
r = IsBrushEmpty(id)
Function
This function can be used to check if the brush specified in id has only invisible pixels, in which case it can be considered "empty". If there are only invisible pixels in the brush, True is returned, False otherwise.

Obviously, a brush can only be "empty" if it uses some kind of transparency, either a mask or an alpha channel. If you call this function on a brush that has neither a mask nor an alpha channel attached, the return value will always be False.

Inputs
id
brush to check
Results
r
True if there are only invisible pixels in the brush, False otherwise
Example
CreateBrush(1, 100, 100, #RED, {Mask = True, Clear = True})
Print(IsBrushEmpty(1))
The code above will print 1 because although the brush is filled with red pixels, none of them will be visible because the mask has all pixels set to invisible.

Show TOC