Chloroplasts are actually plant cell organelles. They convert light energy into relatively stable chemical energy through the process that we know, photosynthesis.
So basically their role in the cell is to convert light energy to aid in the process of photosynthesis.
The pigment is caused by chlorophyll. it is located inside the chloroplast.