(LUA) - Invert levels through 50%

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
Post Reply
tom
Posts: 224
Joined: Thu Jun 26, 2008 5:30 am
Location: The Netherlands

(LUA) - Invert levels through 50%

Post by tom » Fri Feb 12, 2010 9:46 am

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
Light palette : classic
Nederlands Dans Theater.

"Come forth and thy shalt win eternal happiness", but he came fifth, so he won an electric toaster.

Post Reply