An 8-bit palette
The simplest form of quantization is to simply assign 3 bits to red, 3 bits to green and 2 bits to blue, as the human eye is less sensitive to blue light.
So that’s like 3-bit values (0-7) for R and G and a 2-bit value (0-3) for B. I multiply the R and G values by 36 and the B values by 85. Because that seems fine.
elem function from other post.)
colorFromByte gets the RGB-values from a byte and returns some hex:
Which is kind of it. But also code for making palette that can be put on page:
Anyway run the code below to get a palette with clickable colours. Can also adjust some values and things in the code: