summaryrefslogtreecommitdiff
path: root/scripts/s_group_color.lua
blob: 1fd5321ef5f59dba0064cdb7576eb2d5eb6c8408 (plain)
1
2
3
4
5
6
7
8
9
10
11
ardour { ["type"] = "Snippet", name = "Randomize Group Colors" }

function factory () return function ()
	for grb in Session:route_groups ():iter () do
		local r = math.random (0, 255)
		local g = math.random (0, 255)
		local b = math.random (0, 255)
		local rgba = bit32.lshift (r, 24) + bit32.lshift (g, 16) + bit32.lshift (b, 8) + 0xff
		grp:set_rgba(rgba)
	end
end end