[Deep-Fried, Insufferable Geek Alert: there are three color charges, each with a corresponding anti-color. Every gluon carries both a color and an anti-color charge. Shouldn't there be nine kinds of gluon? Why are there only eight?
The combination red-antired + green-antigreen + blue-antiblue is colorless. Therefore, if I assign three gluons that are red-antired, blue-antiblue, and green-antigreen, I'm doing something redundant, because blue-antiblue (for example) is just 0 - red-antired - green-antigreen, and so forth. I'm using three vectors to span a two-dimensional space.
So what we do is choose two of the three color-anticolor pairs, and use them to compose two orthonormal basis vectors (such as g1=(red-antired + blue-antiblue)/sqrt(2), g2=(red-antired - blue-antiblue)/sqrt(2)), with the other gluons being g3=red-antigreen; g4=red-antiblue; g5=green-antiblue; g6=green-antired; g7=blue-antired; g8=blue-antigreen.]
[Atomic Wedgie Geek Alert: The symmetry group of Quantum Chromodynamics is SU(3). In the minimal representation of SU(3), there are three generators...the color charges. In the non-minimal representation, there are 3²-1 generators...the eight gluons! This was spookily mirrored by Murray Gell-Mann's original (1964) quark theory, which also exploited the SU(3) symmetry. Only this time, the minimal representation was the three light quark flavors (up, down, strange), and the non-minimal representation was Gell-Mann's famous Eightfold Way, which correctly(!) predicted the properties of all the light hadrons, including some that had not yet been discovered.]