The leaf sea slug, Elysia chlorotica, is photosynthetic, and spends months living on sunlight just like plants. It steals chloroplasts from the algae that it eats, incorporating them into its own digestive system. It does this through gene transfer.
Most sea hares aren’t capable of that (see an exception above), but they do convert pigments from the algae that they eat into the purple ink that they use for chemical defense.
~Adlysia