Each colour will have an intensity of zero-to-three.
By writing out all possible permutations, we get 64 combinations (three colours, four intensities, 4^3=64)
Red | Green | Blue |
---|---|---|
0 | 0 | 0 |
0 | 0 | 1 |
0 | 0 | 2 |
0 | 0 | 3 |
0 | 1 | 0 |
0 | 1 | 1 |
0 | 1 | 2 |
0 | 1 | 3 |
0 | 2 | 0 |
0 | 2 | 1 |
0 | 2 | 2 |
0 | 2 | 3 |
0 | 3 | 0 |
0 | 3 | 1 |
0 | 3 | 2 |
0 | 3 | 3 |
1 | 0 | 0 |
1 | 0 | 1 |
1 | 0 | 2 |
1 | 0 | 3 |
1 | 1 | 0 |
1 | 1 | 1 |
1 | 1 | 2 |
1 | 1 | 3 |
1 | 2 | 0 |
1 | 2 | 1 |
1 | 2 | 2 |
1 | 2 | 3 |
1 | 3 | 0 |
1 | 3 | 1 |
1 | 3 | 2 |
1 | 3 | 3 |
2 | 0 | 0 |
2 | 0 | 1 |
2 | 0 | 2 |
2 | 0 | 3 |
2 | 1 | 0 |
2 | 1 | 1 |
2 | 1 | 2 |
2 | 1 | 3 |
2 | 2 | 0 |
2 | 2 | 1 |
2 | 2 | 2 |
2 | 2 | 3 |
2 | 3 | 0 |
2 | 3 | 1 |
2 | 3 | 2 |
2 | 3 | 3 |
3 | 0 | 0 |
3 | 0 | 1 |
3 | 0 | 2 |
3 | 0 | 3 |
3 | 1 | 0 |
3 | 1 | 1 |
3 | 1 | 2 |
3 | 1 | 3 |
3 | 2 | 0 |
3 | 2 | 1 |
3 | 2 | 2 |
3 | 2 | 3 |
3 | 3 | 0 |
3 | 3 | 1 |
3 | 3 | 2 |
3 | 3 | 3 |
We only need up to 52 colours, so we've decided to do away with the "darker" colours
(e.g. a block with the colour combination 0 1 0 would have one single green square and three black ones in a 2x2 grid). The easiest way to do this was to sum the totals of RGB and any block with a total of two or less was discarded (0-1-0 gets binned, 0-1-1 gets binned, but 0-0-3 can stay, as can 0-1-2 and so on)
This leaves us with 54 colour combinations:
Red | Green | Blue |
---|---|---|
0 | 0 | 3 |
0 | 1 | 2 |
0 | 1 | 3 |
0 | 2 | 1 |
0 | 2 | 2 |
0 | 2 | 3 |
0 | 3 | 0 |
0 | 3 | 1 |
0 | 3 | 2 |
0 | 3 | 3 |
1 | 0 | 2 |
1 | 0 | 3 |
1 | 1 | 1 |
1 | 1 | 2 |
1 | 1 | 3 |
1 | 2 | 0 |
1 | 2 | 1 |
1 | 2 | 2 |
1 | 2 | 3 |
1 | 3 | 0 |
1 | 3 | 1 |
1 | 3 | 2 |
1 | 3 | 3 |
2 | 0 | 1 |
2 | 0 | 2 |
2 | 0 | 3 |
2 | 1 | 0 |
2 | 1 | 1 |
2 | 1 | 2 |
2 | 1 | 3 |
2 | 2 | 0 |
2 | 2 | 1 |
2 | 2 | 2 |
2 | 2 | 3 |
2 | 3 | 0 |
2 | 3 | 1 |
2 | 3 | 2 |
2 | 3 | 3 |
3 | 0 | 0 |
3 | 0 | 1 |
3 | 0 | 2 |
3 | 0 | 3 |
3 | 1 | 0 |
3 | 1 | 1 |
3 | 1 | 2 |
3 | 1 | 3 |
3 | 2 | 0 |
3 | 2 | 1 |
3 | 2 | 2 |
3 | 2 | 3 |
3 | 3 | 0 |
3 | 3 | 1 |
3 | 3 | 2 |
3 | 3 | 3 |
Where the total sum of colours in a block exceeds three (1-2-3 for example represents 1R-2G-3B) we'll have to mix the colours to make secondary colours (magenta, cyan, yellow) and maybe even black and/or white. But hopefully, using these colour intensity charts as a guide, we'll come up with colour blocks that enable us to uniquely identify a card based on the RGB values received by the LDR/light sensor.
No comments:
Post a Comment