-- ------------------------------------------
-- Cobbled together and imaginatively titled by
-- White--Hawk (GH) - Edited in german by Jackjan
-- Thanks to everyone.
---------------
----------|| CONTROLS: ||--------------
-- --------------- --
-- --
-- --
-- R-Ctrl + --
-- M1 - Cycle R<>G --
-- M2 - Cycle G<>B --
-- M3 - Cycle B<>R --
-- --
-- R-Shift + --
-- M1 - Cycle RGB --
-- M2 - Cycle RBG --
-- M3 - Colour Picker --
-- --
-- While Cycling: --
-- R-Shift + --
-- L-Shift - Faster --
-- L-Ctrl - Slower --
-- --
-- L-Shift + --
-- R-Ctrl - Toggle LHC mode --
-- (G19/G13 sync) --
-- --
-- While Picking: --
-- R-Shift/R-Ctrl (brighter/darker) + --
-- L-Shift - Red --
-- L-Ctrl - Green --
-- L-Alt - Blue --
-- --
-- Press any other MKey to stop --
-- cycling or picking, and keep --
-- selected colour. --
-- --
-- --
-----------------------------------------
-- **Cycle rate:
-- **(default = 150; red-to-red in ~23secs)
-- **(always set lower than mrate)
rate = 150
-- **Minimum delay:
-- **(default = 600; red-to-red in ~1.5mins)
-- **(higher is slower)
mrate = 600
-- Cycle RGB:
if arg==1 then Cycle(0, 5, 0, 1, arg)
-- Cycle RBG:
elseif arg==2 then Cycle(255, -5, 2, -1, arg)
else
-- All done? Re-set new static colour after profiler applies default
one.
Sleep(350)
SetBacklightColor(math.floor(R),math.floor(G),math.floor(B))
end
end
-- Reciprocating fade; Red <> Green or Green <> Blue or Blue <> Red:
if (event=="M_PRESSED") and IsModifierPressed("rctrl") then Fade(arg); end
end
function Fade(ks)
fs=0; fj=5; fd=0; run=1
while run~=null do
-- Ramp colour value 0-255 (and back), or full-off to full-on.
for col = fs, 255-fs, fj do
end
-- Change direction...
if fd==0 then fd=1; fs=255; fj=-5
else fd=0; fs=0; fj=5
end
end
function Dlay(ks)
-- Throttle controls during sleep.
for z = 1, rate, 1 do
-- Faster...
if IsModifierPressed("lshift") and IsModifierPressed("rshift") then
rate=(rate-(mrate/6000))
if rate<2 then rate=2
if limit~=0 then limit=0; OutputLCDMessage("\n"..(string.rep("
",37)).."Maximum", 3000); end
end
-- Increments for display...
dup=math.floor((60/mrate)*rate)
if nup~=dup then Disp(); end
-- Slower...
elseif IsModifierPressed("lctrl") and IsModifierPressed("rshift") then
rate=(rate+(mrate/6000))
if rate>mrate then rate=mrate; end
-- Increments for display...
dup=math.floor((60/mrate)*rate)
if nup~=dup or limit~=1 then Disp(); limit=1; end
end
end
end
function Disp()
-- Draw an incremental slider to G19 LCD output. It grabs/drops focus rapidly.
:S
text="\n\n\n\n\n\n <["..(string.rep("||",60-dup)).."|||"..
(string.rep("-",dup)).."]>"
ClearLCD(); OutputLCDMessage(text, 2000)
nup=dup
end