-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathset_color.py
82 lines (73 loc) · 1.78 KB
/
set_color.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# ./set_color.py
#
# (c) 2010 Konstantin Sering, Nora Umbach, Dominik Wabersich
# <colorlab[at]psycho.uni-tuebingen.de>
#
# GPL 3.0+ or (cc) by-sa (http://creativecommons.org/licenses/by-sa/3.0/)
#
# content:
#
# input: --
# output: --
#
# created
# last mod 2013-01-29 11:15 KS
from psychopy import visual, core
mywin = visual.Window([2048, 1536], monitor='mymon', units='deg',
color=255, colorSpace='rgb255', allowGUI=False, screen=1)
surround1 = visual.GratingStim(win=mywin, units='deg', size=8,
pos=[4,0], sf=0, color=150, colorSpace='rgb255')
infield1 = visual.GratingStim(win=mywin, units='deg', size=2,
pos=[4,0], sf=0, color=100, colorSpace='rgb255')
surround2 = visual.GratingStim(win=mywin, units='deg', size=8,
pos=[-4,0], sf=0, color=100, colorSpace='rgb255')
infield2 = visual.GratingStim(win=mywin, units='deg', size=2,
pos=[-4,0], sf=0, color=50, colorSpace='rgb255')
surround1.draw()
infield1.draw()
surround2.draw()
infield2.draw()
mywin.flip()
core.wait(.5)
surround1.setColor(255)
infield1.setColor(255)
surround2.setColor(255)
infield2.setColor(255)
surround1.draw()
infield1.draw()
surround2.draw()
infield2.draw()
mywin.flip()
core.wait(.5)
surround1.setColor(100)
infield1.setColor(90)
surround2.setColor(200)
infield2.setColor(120)
surround1.draw()
infield1.draw()
surround2.draw()
infield2.draw()
mywin.flip()
core.wait(.5)
surround1.setColor(255)
infield1.setColor(255)
surround2.setColor(255)
infield2.setColor(255)
surround1.draw()
infield1.draw()
surround2.draw()
infield2.draw()
mywin.flip()
core.wait(.5)
surround1.setColor(120)
infield1.setColor(100)
surround2.setColor(180)
infield2.setColor(150)
surround1.draw()
infield1.draw()
surround2.draw()
infield2.draw()
mywin.flip()
core.wait(1)