Skip to content
ExamplesOpen editor ↗

seeloSaMmala

→ colorMode()

Sets or reads how colour numbers are interpreted — `RGB`, `HSB` or `HSL`.

seeloSaMmala() | seeloSaMmala(mode) | seeloSaMmala(mode, max1, max2, max3, maxAlpha)

By default the numbers you give tlatsaMmala, mothaloMmala, bokamorago and bopaMmala are RGB from 0 to 255. seeloSaMmala(HSB, 360, 100, 100) changes that: now the first number is a place on the colour wheel, the second is how strong the colour is, and the third is how bright.

That makes matching colours much easier: change only the hue and leave the rest alone, and you get different colours of the same weight.

It behaves like seeloSaSekhutlo: called with no arguments it returns the current mode rather than setting one.

⚠ A colour remembers the mode it was built in; reading it does not. Changing the mode does not change colours that already exist. But every component is read against the mode you are in now — so one unchanged colour can return different numbers before and after a seeloSaMmala call. Read in the mode you mean.

NameTypeDescription
seelo (optional)tlhomamengRGB, HSB or HSL. Left out, it returns the current mode.
bogolo1 (optional)paloThe maximum of the first component. Given alone it is used for all of them.
bogolo2 (optional)paloThe maximum of the second component.
bogolo3 (optional)paloThe maximum of the third component.
bogoloAlpha (optional)paloThe maximum for alpha.
One colour, in RGB and in HSB
tiro setaLoeto() {
  thalaKanefase(400, 200);
  bokamorago(220);
  tlogelaMothalo();
  tlatsaMmala(0, 255, 255);
  thalaKhutlonne(40, 60, 140, 80);
  seeloSaMmala(HSB, 360, 100, 100);
  kwala(seeloSaMmala());
  tlatsaMmala(180, 100, 100);
  thalaKhutlonne(220, 60, 140, 80);
}
Matching colours by changing only the hue
tiro setaLoeto() {
  thalaKanefase(400, 200);
  bokamorago(20);
  seeloSaMmala(HSB, 360, 100, 100);
  tlogelaMothalo();
  gopheta (diri i = 0; i < 10; i = i + 1) {
    tlatsaMmala(i * 36, 70, 90);
    thalaKhutlonne(i * 38 + 12, 50, 30, 100);
  }
}

RGB, HSB, HSL, bopaMmala, seeloSaSekhutlo