-
Notifications
You must be signed in to change notification settings - Fork 0
/
flag.ps
75 lines (61 loc) · 1.3 KB
/
flag.ps
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
/width 720 def
/height 480 def
/numstar 4 def
/pw 16 def % pw,ph control size of points
/ph 60 def
/npoint 6 def % num points on a star
/barheight 80 def
/starRGB [ 1 0 0] def % red
/barRGB [.702 .867 .949] def % light-blue
/backgroundRGB [ 1 1 1] def % white
/setcolor {
% this allows color to be specified as
% an array [r,g,b] rather than 3 separate vars
aload pop setrgbcolor
} def
/background {
backgroundRGB setcolor
0 0 width height rectfill
} def
/bars {
0 120 moveto
width 0 rlineto
0 360 moveto
width 0 rlineto
barheight setlinewidth
barRGB setcolor
stroke
} def
% draw one point for in a star (a triangle)
/point {
pw neg 0 moveto
pw ph rlineto
pw ph neg rlineto
} def
% draw one star
/star {
/degrees 360 npoint div def
npoint {
point
degrees rotate
} repeat
} def
/stars {
% compute horiz distance between stars
% (equally spaced with pad 10 on both sides)
% ie sdist = (width - 20)/(numstar+1)
/sdist width 20 sub numstar 1 add div def
% move to first:
10 sdist add height 2 div translate
numstar {
star
sdist 0 translate
} repeat
starRGB setcolor
fill
} def
%---main---
background
bars
stars
showpage