Skip to content

Instantly share code, notes, and snippets.

@Nama
Created July 2, 2015 20:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nama/ddbb0a83d167e52d0d41 to your computer and use it in GitHub Desktop.
Save Nama/ddbb0a83d167e52d0d41 to your computer and use it in GitHub Desktop.
Small script for Logitech keyboards with different backlight colors. Changes the color of the backlight permanently, smooth! Shouldnt be hard to make it use on keyboards with just two colors.
function OnEvent(event, arg)
if (event == "PROFILE_ACTIVATED") then
color()
end
end
function color()
r1 = 0
g1 = 0
b1 = 0
while true do
r2 = math.random(255)
g2 = math.random(255)
b2 = math.random(255)
for loop = 0, 255, 5 do
SetBacklightColor((r2*loop+r1*(255-loop))/255, (g2*loop+g1*(255-loop))/255, (b2*loop+b1*(255-loop))/255, "kb");
Sleep(50);
end
r1 = r2
g1 = g2
b1 = b2
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment