You can use sublist
to extract to number of colors that you want from your list of desired colors:
let colors sublist [ red blue green orange brown ] 0 groups
ask turtles [ set color one-of colors ]
If you didn't want to always get the same colors in the same order, you could use n-of
and base-colors
:
let colors n-of groups base-colors