Macro transparency

Source
macro_rules! transparency {
    ($($x:expr),*) => { ... };
}
Expand description

Utility macro to construct a transparency array from bits. Can be used when creating an Image.

The number of bits doesn’t have to match the image length, missing data will be interpreted as fully opaque.

let transparency = transparency![0, 0, 1, 0];

The result is that the 3rd pixel is transparent, and all other pixels are opaque.