Advertisement
williamaadams

colorcir example from GhostScript

Sep 19th, 2019
3,039
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %!
  2. /colorcirsave save def      % prevent left over effects
  3.  
  4. gsave
  5. /Tahoma findfont 24 scalefont setfont
  6. 72 72 translate 0 0 moveto 1 0 0 setrgbcolor (Red) show
  7. 72 0 translate 0 0 moveto 0 1 0 setrgbcolor (Green) show
  8. 72 0 translate 0 0 moveto 0 0 1 setrgbcolor (Blue) show
  9. 72 0 translate 0 0 moveto 1 1 0 setrgbcolor (Yellow) show
  10. 72 0 translate 0 0 moveto 1 0 1 setrgbcolor (Pink) show
  11. 72 0 translate 0 0 moveto 0 1 1 setrgbcolor (Cyan) show
  12. 72 0 translate 0 0 moveto 0.9 0.9 0.9 setrgbcolor ('White') show
  13. grestore
  14.  
  15. %0.0 setlinewidth
  16. 0.1 setlinewidth
  17.  
  18. /length 0.1 def
  19. /width 0.02 def
  20. /hsvcircle {
  21. gsave
  22.     /h 0.0 def
  23.     0 4 360 {
  24.     pop
  25.     gsave
  26.     0.5 0.0 translate
  27.  
  28.     newpath
  29.     0.0 0.0 moveto
  30.     length 0.0 lineto
  31.     length width lineto
  32.     0.0 width lineto
  33.     closepath
  34.     h 1.0 1.0 sethsbcolor
  35.     fill
  36.  
  37.     %newpath
  38.     %0.0 0.0 moveto
  39.     %length 0.0 lineto
  40.     %length width lineto
  41.     %0.0 width lineto
  42.     %closepath
  43.     %0.0 setgray
  44.     %stroke
  45.  
  46.     grestore
  47.     /h h 4 360 div add def
  48.     4 rotate
  49.     } for
  50. grestore
  51. } def
  52.  
  53. /graycircle {
  54. gsave
  55.     /h -1.0 def
  56.     0 4 360 {
  57.     pop
  58.     gsave
  59.     0.5 0.0 translate
  60.  
  61.     newpath
  62.     0.0 0.0 moveto
  63.     length 0.0 lineto
  64.     length width lineto
  65.     0.0 width lineto
  66.     closepath
  67.  
  68.     h abs setgray
  69.     fill
  70.  
  71.     %newpath
  72.     %0.0 0.0 moveto
  73.     %length 0.0 lineto
  74.     %length width lineto
  75.     %0.0 width lineto
  76.     %closepath
  77.     %0.0 setgray
  78.     %stroke
  79.     grestore
  80.  
  81.     /h h 8 360 div add def
  82.     4 rotate
  83.     } for
  84. grestore
  85. } def
  86.  
  87. 0.0 setlinewidth
  88. 0.0 setgray
  89. 300 400 translate
  90. 500 500 scale
  91.  
  92. 30 rotate
  93. 1.0 0.7 scale
  94. -30 rotate
  95.  
  96. hsvcircle
  97. 0.8 0.8 scale
  98. graycircle
  99. 0.8 0.8 scale
  100. hsvcircle
  101. 0.8 0.8 scale
  102. graycircle
  103. 0.8 0.8 scale
  104. hsvcircle
  105. 0.8 0.8 scale
  106. graycircle
  107. 0.8 0.8 scale
  108. hsvcircle
  109. 0.8 0.8 scale
  110. graycircle
  111. 0.8 0.8 scale
  112. hsvcircle
  113. 0.8 0.8 scale
  114. graycircle
  115. 0.8 0.8 scale
  116. hsvcircle
  117. 0.8 0.8 scale
  118. graycircle
  119. 0.8 0.8 scale
  120. hsvcircle
  121. 0.8 0.8 scale
  122. graycircle
  123.  
  124. showpage
  125. %clear cleardictstack
  126. %colorcirsave restore
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement