# Changing the Color of a point based on a RNG

I am trying to simulate randomly selecting beads from a jar. Is there a way to change the color of a point based on a number from a shuffled list?

Let’s say I have a list of 1000 numbers. 1-350 is green, 351-1000 is red.
If I create 20 points, is there a way I can assign them a color based on a number in the shuffled list?
If I have a point at (1,1) and the first number in the shuffled list is 401, the point should be red.
If I have a point at (1,2) and the second number in the list is 14, the point should be green.

A quick rough-and-ready way of doing what you want as you describe:

Let me know if there’s anything that does not make sense. I included the list of 1000 numbers as you described, though depending on what else you need it may be more efficient to ignore having a list of numbers and just do something like:

`C=[{i>0.35:rgb(255,0,0),rgb(0,255,0)} for i=random(20)]`

@pirsquared’s solution is elegant and neat. My less elegant suggestion was going to plot all the points in both colors and then restrict them to only appear if an inequality was satisfied. E.g. for `L=shuffle([1,...,1000)]`, the input `(3,[1,...,20]{L>350})` would plot the points of the form (3,[1,…,20]) only when the corresponding value of L>350.