Skip to content
ExamplesOpen editor ↗

alpha

→ alpha()

Reads how opaque a colour is — how much of what is behind it shows through.

alpha(colour)

The name is left as it stands for the same reason PI is left as PI: alpha is notation, not vocabulary. It is a Greek letter used across all of computing for a colour’s opacity, and no written Setswana word for it exists in any source consulted.

The page explains the idea instead: alpha says how solid a colour is. A high alpha paints a solid colour; a low one makes it like glass, and what is behind shows through.

By default it returns a number from 0 to 255: a solid colour returns 255, and bopaMmala(0, 0, 0, 128) returns 128. Like the other components it follows the mode you are in.

NameTypeDescription
mmalammalaThe colour to read.
Circles at different opacities
tiro setaLoeto() {
  thalaKanefase(400, 200);
  bokamorago(220);
  tlogelaMothalo();
  gopheta (diri i = 0; i < 5; i = i + 1) {
    metlha mmala = bopaMmala(230, 60, 90, i * 50 + 55);
    kwala(alpha(mmala));
    tlatsaMmala(mmala);
    thalaSediko(i * 78 + 44, 100, 90);
  }
}

bohibidu, bopaMmala, phimola