transform_rpn = dopts.transform_rpn or "0,+",
noarea = dopts.noarea or false,
title = dopts.title or nil,
- weight = dopts.weight or nil,
+ weight = dopts.weight or
+ (dopts.negweight and -tonumber(dinst)) or
+ (dopts.posweight and tonumber(dinst)) or nil,
ds = dsource,
type = dtype,
instance = dinst,
return x < y
end)
+ -- define colors in order
+ if opts.ordercolor then
+ for i, source in ipairs(_sources) do
+ source.color = self.colors:defined(i)
+ end
+ end
+
-- create DEF statements for each instance
for i, source in ipairs(_sources) do
-- fixup properties for per instance mode...
)
end
+function Instance.defined( self, i )
+ local t = {
+ {230, 25, 75},
+ {245, 130, 48},
+ {255, 225, 25},
+ {60, 180, 75},
+ {70, 240, 240},
+ {0, 130, 200},
+ {0, 0, 128},
+ {170, 110, 40}
+ }
+ return string.format(
+ "%02x%02x%02x",
+ t[(i-1) % #t + 1][1], t[(i-1) % #t +1][2], t[(i-1) % #t + 1][3] )
+end
+
function Instance.random( self )
local r = math.random(255)
local g = math.random(255)