The nucleus is composed of neutral neutrons and positively charged protons. The opposite charge of the electron and proton binds the atom together with electromagnetic forces. Quarks in baryons and mesons are bound together by the strong force in the form of the exchange of gluons. Much like how the electromagnetic force strength is determined by the amount of electric charge, the strong force strength is determined by a new quantity called color charge. And, just to be more confusing, color charge also has its anti-particle nature.
Gluons serve the function of carrying color when they interact with quarks.
Baryons and mesons must have a mix of colors such that the result is white. For example, red, blue and green make white. Also red and anti-red make white. There can exist no free quarks, i.e. quarks by themselves. All quarks must be bound to another quark or antiquark by the exchange of gluons.