2013-07-24 15:47:52 +00:00
|
|
|
|
|
|
|
function sk_scrape_startcanvas(c, fileName) end
|
|
|
|
|
|
|
|
function sk_scrape_endcanvas(c, fileName) end
|
|
|
|
|
2013-08-01 17:32:56 +00:00
|
|
|
count3 = 0
|
|
|
|
count3sym = 0
|
|
|
|
|
2013-07-24 15:47:52 +00:00
|
|
|
function sk_scrape_accumulate(t)
|
|
|
|
local p = t.paint
|
|
|
|
if p then
|
|
|
|
local s = p:getShader()
|
|
|
|
if s then
|
|
|
|
local g = s:asAGradient()
|
|
|
|
if g then
|
2013-08-01 17:32:56 +00:00
|
|
|
--io.write(g.type, " gradient with ", g.colorCount, " colors\n")
|
|
|
|
|
|
|
|
if g.colorCount == 3 then
|
|
|
|
count3 = count3 + 1
|
|
|
|
|
|
|
|
if (g.midPos >= 0.499 and g.midPos <= 0.501) then
|
|
|
|
count3sym = count3sym + 1
|
|
|
|
end
|
|
|
|
end
|
2013-07-24 15:47:52 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-08-01 17:32:56 +00:00
|
|
|
function sk_scrape_summarize()
|
|
|
|
io.write("Number of 3 color gradients: ", count3, "\n");
|
|
|
|
io.write("Number of 3 color symmetric gradients: ", count3sym, "\n");
|
|
|
|
end
|
2013-07-24 15:47:52 +00:00
|
|
|
|