Debian Codegraph @

test/sys/colour.praat

raw
1 # colour.praat
2 # Paul Boersma 2019-11-05
3
4 Times
5 10
6 Erase all
7 Select outer viewport: 0, 6, 0, 9
8 Axes: 0, 100, 0, 100
9
10 #
11 # Old syntax.
12 #
13
14 y = 100
15
16 y -= 5
17 Green
18 Text... 50 right y half This is blue:
19 Paint rectangle... blue 50 100 y-2 y+2
20
21 y -= 5
22 Blue
23 Text... 50 right y half This is 0.25 grey:
24 Paint rectangle... 0.5-0.25 50 100 y-2 y+2
25
26 y -= 5
27 Yellow
28 Text... 50 right y half This is teal:
29 Paint rectangle... {0.25,0.1,0.2} 50 100 y-2 y+2
30
31 #
32 # New syntax.
33 #
34
35 y -= 2
36
37 y -= 5
38 Black
39 Text: 50, "right", y, "half", "This is red:"
40 Paint rectangle: "red", 50, 100, y-2, y+2
41
42 y -= 5
43 Blue
44 Text: 50, "right", y, "half", "This is 0.75 grey:"
45 Paint rectangle: 0.25+0.5, 50, 100, y-2, y+2
46
47 y -= 5
48 Maroon
49 Text: 50, "right", y, "half", "This is lime:"
50 Paint rectangle: "lime", 50, 100, y-2, y+2
51
52 y -= 5
53 Pink
54 Text: 50, "right", y, "half", "This is brown:"
55 Paint rectangle: "{ 0.1, 0.3, 0.2 }", 50, 100, y-2, y+2
56
57 y -= 5
58 Maroon
59 Text: 50, "right", y, "half", "This is lila:"
60 Paint rectangle: {0.3+0.4, 0.6, 0.8}, 50, 100, y-2, y+2
61
62 y -= 5
63 Navy
64 Text: 50, "right", y, "half", "This is 0.3 grey:"
65 Paint rectangle: {0.1+0.2}, 50, 100, y-2, y+2
66
67 y -= 5
68 Olive
69 Text: 50, "right", y, "half", "This is not drawn:"
70 asserterror Cannot compute a colour
71 Paint rectangle: "{ vxcvxcvbxvbcvb", 50, 100, y-2, y+2
72
73 y -= 5
74 Olive
75 Text: 50, "right", y, "half", "This is not drawn:"
76 asserterror Cannot compute a colour
77 Paint rectangle: "vxcvxcvbxvbcvb", 50, 100, y-2, y+2
78
79 y -= 5
80 Olive
81 Text: 50, "right", y, "half", "This is not drawn:"
82 asserterror Cannot compute a colour
83 Paint rectangle: "0.3", 50, 100, y-2, y+2
84