summaryrefslogtreecommitdiff
path: root/examples/colorcir.ps
blob: ec57be6c6dd86c1a78799c96853e12465185b15d (plain)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
%!
/colorcirsave save def		% prevent left over effects

gsave
/Times-Roman findfont 24 scalefont setfont
72 72 translate 0 0 moveto 1 0 0 setrgbcolor (Red) show
72 0 translate 0 0 moveto 0 1 0 setrgbcolor (Green) show
72 0 translate 0 0 moveto 0 0 1 setrgbcolor (Blue) show
72 0 translate 0 0 moveto 1 1 0 setrgbcolor (Yellow) show
72 0 translate 0 0 moveto 1 0 1 setrgbcolor (Pink) show
72 0 translate 0 0 moveto 0 1 1 setrgbcolor (Cyan) show
72 0 translate 0 0 moveto 0.9 0.9 0.9 setrgbcolor ('White') show
grestore

0.0 setlinewidth

/length 0.1 def
/width 0.02 def
/hsvcircle {
gsave
    /h 0.0 def
    0 4 360 {
    pop
    gsave
    0.5 0.0 translate

    newpath
    0.0 0.0 moveto
    length 0.0 lineto
    length width lineto
    0.0 width lineto
    closepath
    h 1.0 1.0 sethsbcolor
    fill

    %newpath
    %0.0 0.0 moveto
    %length 0.0 lineto
    %length width lineto
    %0.0 width lineto
    %closepath
    %0.0 setgray
    %stroke

    grestore
    /h h 4 360 div add def
    4 rotate
    } for
grestore
} def

/graycircle {
gsave
    /h -1.0 def
    0 4 360 {
    pop
    gsave
    0.5 0.0 translate

    newpath
    0.0 0.0 moveto
    length 0.0 lineto
    length width lineto
    0.0 width lineto
    closepath

    h abs setgray
    fill

    %newpath
    %0.0 0.0 moveto
    %length 0.0 lineto
    %length width lineto
    %0.0 width lineto
    %closepath
    %0.0 setgray
    %stroke
    grestore

    /h h 8 360 div add def
    4 rotate
    } for
grestore
} def

0.0 setlinewidth
0.0 setgray
300 400 translate
500 500 scale

30 rotate 
1.0 0.7 scale
-30 rotate 

hsvcircle
0.8 0.8 scale
graycircle
0.8 0.8 scale
hsvcircle
0.8 0.8 scale
graycircle
0.8 0.8 scale
hsvcircle
0.8 0.8 scale
graycircle
0.8 0.8 scale
hsvcircle
0.8 0.8 scale
graycircle
0.8 0.8 scale
hsvcircle
0.8 0.8 scale
graycircle
0.8 0.8 scale
hsvcircle
0.8 0.8 scale
graycircle
0.8 0.8 scale
hsvcircle
0.8 0.8 scale
graycircle

clear cleardictstack
colorcirsave restore
% Per page independence description in the PLRM Section 3.7.3, showpage follows restore
showpage