Both quarks and gluons carry a type of charge called color. Like electric charge, color charge is always conserved. But unlike the electric charge, the color charge comes in six varieties, three colors and three anti-colors. The colors are usually called red, green, and blue. The idea is that we know that protons and neutrons as well as hadrons are made up of quarks. Yet we never see color charge even if we try to break up protons and neutrons into their constituent parts (colored quarks). So the objects that we observe, and therefore construct, must be colorless or color neutral; which is why we cannot see individual quarks. When each quark in a hadron has a different color:

red+ green + blue = white

the result is a color neutral object. This also allows the quark theory to describe another class of particles: mesons which have a quark and an anti-quark

color + anti-color = white

Gluons carry color/anti-color pairs that do not have to be the same color. There are 8 gluons as they each have one of the eight possible color/anti-color combinations.
See Quantum Chromodynamics