Home | History | Annotate | Download | only in lua
      1 
      2 function sk_scrape_startcanvas(c, fileName) end
      3 
      4 function sk_scrape_endcanvas(c, fileName) end
      5 
      6 count3 = 0
      7 count3sym = 0
      8 
      9 function sk_scrape_accumulate(t)
     10     local p = t.paint
     11     if p then
     12         local s = p:getShader()
     13         if s then
     14             local g = s:asAGradient()
     15             if g then
     16                 --io.write(g.type, " gradient with ", g.colorCount, " colors\n")
     17             
     18                 if g.colorCount == 3 then
     19                    count3 = count3 + 1
     20 
     21                    if (g.midPos >= 0.499 and g.midPos <= 0.501) then
     22                       count3sym = count3sym + 1
     23                    end
     24                 end    
     25             end
     26         end
     27     end
     28 end
     29 
     30 function sk_scrape_summarize() 
     31          io.write("Number of 3 color gradients:  ", count3, "\n");
     32          io.write("Number of 3 color symmetric gradients:  ", count3sym, "\n");
     33 end
     34 
     35