[Oberon] PO2013 - Colour Ergonomy

Tomas Kral thomas.kral at email.cz
Tue Jun 30 10:19:43 CEST 2020


I have coded this snippet, it cycles backdrop RGB colour on Pepino
board. As RGB is defined by h/w as RRRGGGBB, I cannot get all shades, but R0G0B0, only.

Taking opportunity to ask, how many Pepino users out there, and what your colours are?

MODULE Map;  (*TK 21.6.2020 rgb Pepino LX9*)
  IMPORT SYSTEM, Display, Out;
  CONST ms = -128; c = 15; (*backdrop*)

  VAR r, g, b: BYTE; rgb: INTEGER;

  PROCEDURE Set; (*R0G0B0*)
  BEGIN rgb := r*100000H + g*1000H + b*10H;
    SYSTEM.PUT(ms + c*4, rgb)
  END Set;

  BEGIN Out.Hex(rgb); Out.Ln
  END Show;

  PROCEDURE R*; (*3 bits*)
  BEGIN INC(r, 2); r := r MOD 10H; Set
  END R;

  PROCEDURE G*; (*3 bits*)
  BEGIN INC(g, 2); g := g MOD 10H; Set
  END G;

  PROCEDURE B*; (*2 bits*)
  BEGIN INC(b, 4); b := b MOD 10H; Set
  END B;

BEGIN r := 0; g := 0; b := 0
END Map.

Map.R  Map.G  Map.B  Map.Show

These are good for day and night work.

DispTest.SetMap  15 0404040H  dark
DispTest.SetMap  14 0C0C080H

DispTest.SetMap  15 0606040H  grey
DispTest.SetMap  14 0C0C080H

DispTest.SetMap  15 0000080H  blue
DispTest.SetMap  14 0C0C080H

Tomas Kral <thomas.kral at email.cz>

More information about the Oberon mailing list