How to get random numbers in a macro?

I have a macro that changes a part to a list of colors the user selects.  I would like to make another macro that changes the color to a random color in a list.   Say I have a list of 10 colors.  How can I get the macro to randomly select one of those colors?   Im thinking I need some type of random number generator from 1 to 10, which has a color associated to each number.  Each time the user clicks on the macro button, it will change the color of the part.

SolidworksApi macros