Skip to content
ExamplesOpen editor ↗

bohibidu

→ red()

Reads how much red a colour contains.

bohibidu(colour)

The name is bohibidu — “redness” — not khibidu (“red”), because the function reads an amount of a component rather than naming a colour. That also leaves khibidu free as a variable name a learner can use.

By default it returns a number from 0 to 255 — the same number you typed.

⚠ The number you get back depends on the mode you are in NOW, not on the numbers you wrote. Build a colour with bopaMmala(255, 128, 64), then say seeloSaMmala(RGB, 100), and bohibidu returns 100, not 255 — the colour has not changed, the scale it is being read against has. That is why it pays to return to the mode you meant before reading.

NameTypeDescription
mmalammalaThe colour to read — built with bopaMmala, an array of components, or a CSS string.
Read the red and use it again
tiro setaLoeto() {
  thalaKanefase(400, 200);
  bokamorago(220);
  tlogelaMothalo();
  metlha mmala = bopaMmala(255, 128, 64);
  kwala(bohibidu(mmala));
  seeloSaMmala(RGB, 100);
  kwala(bohibidu(mmala));
  seeloSaMmala(RGB, 255);
  tlatsaMmala(mmala);
  thalaKhutlonne(40, 60, 140, 80);
  tlatsaMmala(bohibidu(mmala), 0, 0);
  thalaKhutlonne(220, 60, 140, 80);
}

botalaJwaTlhaga, botalaJwaLoapi, alpha, bopaMmala