Page 1 of 1

(LUA) - Invert levels through 50%

Posted: Fri Feb 12, 2010 9:46 am
by tom
Quite like roberts flip flop code but this looks at the intensity of the fixtures and compares it to 50%. Passing it through this. 100% = 0%, 40% = 60% and so on. Handy for flipping out a gradient line of PARs or inverting an image on a matrix or something.

Code: Select all

s = HC.GetCurrentSelectionSet(',')

for fixture in string.gmatch(s,"%d+") do
y =50
x = tonumber(HC.AttributeGetValue(fixture, 'Intensity'))
if x < 50 then y = y + (50 - x)end
if x > 50 then y = y - (x - 50)end
if x == 50 then y = 50 end
HC.AttributeFade(fixture, y)
end