Camera noob here. I'm really just a programmer who recently became interested in barcodes with multiple colors to represent information, rather than just black and white. This overlaps with cameras due to the nature of colors and pictures, but I don't have much experience with photography. I'll give you some context as to why I'm interested in case any are wondering, and then move on to my question.
The background for my interest is that, using RGB codes, a single pixel can represent a 256^3 numbers (around 17 million), but the difference between each color is 1 value, and it would be near impossible to accurately detect on camera. Using boundaries between pixel values, I can make the distance between numbers larger, and the tolerance greater, but it reduces the amount of possible information. So, I wanted to find the combination of codes that maximizes both information storage and readability.
My question then is, what conditions affect a cameras ability to accurately perceive RGB codes? I know level of light would affect its ability and I'm sure internal specs cause it to vary from camera to camera, but if I were to do research into each factor specifically, what would be a good jumping-off point for terms and concepts to look into?