Randomly selecting color values from list

I want to randomly select two colours from a long list of RGB values like this, where each inner bracket is a different colour:

colours = [[1,1,1],[1,2,3],[2,3,4]];

However, the only constraint is that each color has to be at least 95 degrees away from each other, or 10 items apart in the list. What would be a way to do this in Psychopy or Javascript?

Hey Psych,

If I would rephrase your question like this, does that make sense?

i is the current index in your list and j is the next index. j should be in the range <i - 10, i + 10>. If j is < 0 of larger than the list length, draw a new value for j.

Best, Thomas