I made a blender cube, but the colors are grey
You most likely did not change the material's Base Color, but instead changed the Viewport Display color.
For the green color to show up in your render you need to modify the material base color itself:

In order to see the material, you need to switch to LookDev mode. Not solid mode. Click on the button in the below image:

Hope this helps.