Sea slugs don't have shells to protect them from predators. Those that feed on corals protect themselves by taking on the colour of the corals.
Corals get their colour from the algae inside their body tissues. When a sea slug eats a coral, the algae is separated from the tissues in its stomach. The slug is able to take out the live algae from its stomach and put them over the long tentacles that sprout from its back. The algae, being the same colour as the coral, provide a perfect camouflage for the sea slug.
One species of sea slug, living in Australia's Great Barrier Reef, is able to stimulate the captive algae to proliferate. When the algae start growing, the slug develops extra tentacles along its flanks so that the algae can spread out and grow into large colonies.