On the Subject of RGB Arithmetic

Color Math reworded (SpeakingEvil).html

The module has two 4×4 grids of RGB colours with LEDs in each corner.

Each colour gives three digits, corresponding to each colour channel:

  • If the channel is not present at all, the digit is “-”.
  • If the channel is maximised, the digit is “+”.
  • Otherwise the digit is “0”.

Each LED on the corners of each screen corresponds to a transformation to be applied to the respective colour channel on the grid:

  • Top left- Flip the grid horizontally.
  • Top right- Flip the grid vertically.
  • Bottom left- Swap the rows and columns i.e. A2 ↔ B1.
  • Bottom right- Invert the channel i.e. + ↔ -.

If the same transformation is applied to multiple channels, its respective LED additively mixes the corresponding colours.

The module has three stages:

  1. No transformations are applied to either grid.
  2. The same transformations are applied to all three colour channels.
  3. No limitations on which transformations can be applied.

Take a 4×4 grid which contains cell labelled 1 to 16 in reading order. The positions post-modifications are as follows:

Case 1: 1 out of 3 LEDs of TL, TR and BL is lit

TL TR BL
4 3 2 1
8 7 6 5
12 11 10 9
16 15 14 13
13 14 15 16
9 10 11 12
5 6 7 8
1 2 3 4
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16

Case 2: 2 out of 3 LEDs of TL, TR and BL is lit

TL, TR TR, BL TL, BL
16 15 14 13
12 11 10 9
8 7 6 5
4 3 2 1
4 8 12 16
3 7 11 15
2 6 10 14
1 5 9 13
13 9 5 1
14 10 6 2
15 11 7 3
16 12 8 4

Case 3: 3 out of 3 LEDs of TL, TR and BL is lit

Bruh
16 12 8 4
15 11 7 3
14 10 6 2
13 9 5 1

The right screen displays a character corresponding to one of the operators below.
Apply the operator to the digits corresponding each colour channel of each square in the same position of the respective transformed grids.
The result of the operation corresponds to the channel of the target colour of the respective square in the centre grid.

Sym Cond I Cond II/ Else Else
+ Take the sum*.
! Take the negative sum*.
Multiply* the input.
m Contains - - Contains 0 0 +
M Contains + + Contains 0 0 -
# Both 0 0 Either 0 - +
Same Sym Symbol not present
Ø Same 0 Contains 0 - +
Doesn’t contain 0 0 Non-zero value
* Treat + as +1; - as -1 and 0 as 0. If answer is positive, the output is + and vice versa.

Use the three RGB selectors to generate the target colours, and select the squares on the centre grid to fill them with the selected colour.

Press the check button to submit the colours of the centre grid:

  • If all colours match the target, the center grid will flash green and the module will progress to the next stage.
  • Otherwise:
    • Squares that match the target colour will flash green before returning to the submitted colour.
    • Squares that do not match the target colour will flash red before resetting and turning black.

Pressing the reset button will turn every square in the centre grid black.

Method 2: Altered Input to Output table

Apply the output from left to right. Symbols order are reversible (e.g. +- == -+).
Symbols used are --, 00, ++, -0, +0, and +-.

+ -- / -0 +- / 00 ++ / +0
- 0 +
! +0 / ++ +- / 00 -0 / --
- 0 +
+- -0 / +0 / 00 -- / ++
- 0 +
m -- / +- / -0 00 / +0 ++
- 0 +
M -- 00 / -0 ++ / +- / +0
- 0 +
# -0 / +0 00 -- / ++ / +-
- 0 +
-- / +0 00 / +- ++ / -0
- 0 +
Ø -0 / +0 -- / 00 / ++ +-
- 0 +
-0 -- / 00 / ++ / +- +0
- 0 +

Appendix: Colour referencing

The chart below can be used to reference the possible colours on the module.