There is a strong analogy but also important differences.
Electrons carry electric charge, which means that they can absorb or emit photons (photons are said to "couple" to electric charge). Photons themselves, though, are electrically neutral and so do not interact with each other.
Quarks carry "color" charge, which is the charge gluons couple to. So quarks absorb and emit gluons in the same way that electrons absorb and emit photons. The analogy here is very strong; the underlying mathematics so far is identical. The absorption and emission of gluons by quarks leads to a "color force" (more commonly, the "strong force") between quarks which is analogous to the electromagnetic force between electrons, which arises from the emission and absorption of photons by electrons.
There are two main differences, though. First, there are three types of color charge: "red, green, and blue." Thus while there is only one electron, with electric charge -1, there are really three quarks of any given flavor: a red quark, a green quark, and a blue quark. Second, gluons themselves carry color charge (in contrast to the case of electrodynamics where the photon is electrically neutral). The fact that gluons have color charge means that gluons can absorb and emit other gluons, which ends up making the mathematical analysis of the strong interaction horribly complicated. Gluons carry color charge somewhat differently from quarks: each gluon has a color and an anti-color. So there is a red-antigreen gluon, a blue-antired gluon, etc. Counting these up you might think that there should be nine gluons, but in fact one of these doesn't exist for group theoretical reasons, so there are eight gluons (in contrast to electrodynamics where there is only one photon).