wps

PostScript for the Web
git clone https://logand.com/git/wps.git/
Log | Files | Refs | LICENSE

fill.wps (383B)


      1 % based on the JavaScript example from
      2 % https://developer.mozilla.org/samples/canvas-tutorial/4_1_canvas_fillstyle.html
      3 
      4 /n 5 def
      5 /w 25 def
      6 
      7 0 0 n w mul dup .gbox
      8 
      9 4 dict begin
     10   0 1 n {
     11     /i exch def
     12     /ii 1 1 n div i mul sub def
     13     0 1 n {
     14       /j exch def
     15       /jj 1 1 n div j mul sub def
     16       ii jj 0 setrgbcolor
     17       w j mul w i mul w w rectfill
     18     } for
     19   } for
     20 end