User Tools

Site Tools


script_tint_hues

====== About the script ====== * Purpose : Generates nice random tint hues and applies them to your current 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> var 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; var hsv = [hue, 0.4, 0.4]; var color = Color.HSVToColor(0x80, hsv); desktop.getProperties().edit() .setInteger("bgColor", color) .commit(); </sxh>

script_tint_hues.txt · Last modified: 2015/09/25 02:58 by bdjnk