The glass that splits light into its spectrum — one beam revealed as many colors; and the syntax highlighter wearing the name.
Greek prisma (a thing sawn, a sawn body), from priein (to saw); a prism is named for its cut shape, and only later for what that shape does to light.
The glass that shows one beam of light was always several colours travelling together. The syntax highlighter borrows the name for the same reason: it does not add colour to code, it reveals the structure that was already there.