User Tools

Site Tools


script_tint_hues

**This is an old revision of the document!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

====== About the script ====== * Purpose : Generates nice random tint hues and applies them to your Lightning Launcher desktop wallpaper * Author : [[http://michael.plotke.me/|Michael Plotke]] * Link : [[http://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/|Inspiration]] ====== How to use the script ====== Assign it to an //event// occurring on your //desktop//, for example //double-tap empty space//. ====== Script code ====== <sxh javascript> golden_ratio_conjugate = 0.618033988749895; var desktop = LL.getCurrentDesktop(); var hue = desktop.getTag("hue"); if (!hue) { hue = Math.random(); } else { hue = parseFloat(hue); } hue += golden_ratio_conjugate; hue %= 1; desktop.setTag("hue", hue.toString()); hue *= 360; hsv = [hue, 0.4, 0.4]; var color = Color.HSVToColor(0x80, hsv); desktop.getProperties().edit() .setInteger("bgColor", color) .commit(); </sxh>

script_tint_hues.1443146269.txt.gz · Last modified: 2015/09/25 01:57 by bdjnk