Using the context menu for a specific part (or group of selected parts) you can customize not only the color of the part, but also assign a material (and thereby, a density), as well as specify a custom density without assigning a material. Onshape provides a material library for your use, and you are also able to add (or remove) your own custom material libraries.

For an additional Learning center resource, follow the technical briefing article here: Best Practices for Managing Custom Libraries (Onshape account required).