Ok, I remember figuring this out a long time ago. You want two colours of sectors. The sectors alternate yellow, black.
There may be a way to do this with transparency, but as far as I can tell, the sectors that you do not define are drawn in the complement of the colour you do define. So, the sectors you called Yellow, were in fact Yellow but the others were drawn in Yellow’s complement which is Blue. There is no easy way (actually I hope there is) to tell the Radial Stim to draw the missing sectors in a specified colour or make them invisible so the background show through. To get what you want, conceptually you can draw the even numbered sectors in black and the odd numbered sectors in background Yellow (then add your background coloured circle in the middle to truncate the sectors. Here is a sample using units=‘pix’ and colourSpace=rgb
Yellow= ( 1.0, 1.0, -1.0)
Black= (-1.0, -1.0, -1.0)
inner_radius = 256
outer_radius =396
inner_stim = visual.Circle(win=the_screen, size=(inner_radius, inner_radius), pos=(0,0), units='pix',colorSpace='rgb', fillColor=Yellow )
for p in range(0,360,30) :
piece1=visual.Pie(the_screen, radius=outer_radius, start=p, end=p+15, edges=32, units='pix', lineWidth=0, lineColor=False,
fillColor=Black, pos=(0, 0), interpolate=False, colorSpace='rgb')
piece2=visual.Pie(the_screen, radius=outer_radius, start=p+15, end=p+30, edges=32, units='pix', lineWidth=0, lineColor=False,
fillColor=Yellow, pos=(0, 0), interpolate=False, colorSpace='rgb')
piece1.draw()
piece2.draw()
inner_stim.draw()
the_screen.flip(clearBuffer=True)
You can fix the magic numbers that set the section widths (the 30 in the ‘p in range’ and the +15 in the pieces).
If you are going to animate this or redraw it frequently, it is a good idea to premake and save a set of these and the just draw the bitmaps. If you have a really powerful machine and graphics card, then drawing these on the fly might be ok.