OpenSCAD supports setting the colour of objects using "web colour" names (documented here), however (as far as I know) it does not have an easy to use list of these colour names so you can't easily pick a colour from a colour by index or random number.
This library provides lists of all colours based on the extended web colours listed at https://en.wikipedia.org/wiki/Web_colors#Extended_colors. Each colour range is in a separate list and there is another list will all colours.