How to Randomly assign specified colors from Styles to faces & edges ?

 From:  Michael Gibson
10222.6 In reply to 10222.1 
Hi Ed,

re:
> But is there a way to specify just a subset of colors from the Styles?

So the code that generates the style index is this part here (it's in 2 places in the script one for where it sets up edges and another faces):

styleIndex = Math.floor(Math.random() * styles.length);

If you wanted it to choose only from the first 10 styles, you could do it like this instead:

styleIndex = Math.floor(Math.random() * 10);

If you wanted it to choose from the last 10 styles, you could do it like this:

styleIndex = styles.length - 1 - Math.floor(Math.random() * 10);

- Michael