We recommend the listings package (pdf) which can be used for code boxes, and in which you can set custom colors, e.g. see this beamer example on tex.stackexchange.