From a55fb928a7f8c2af5ce71ff0b8cb5a1006f4011d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 3 May 2017 17:47:16 +0200 Subject: Lua bindings to set group color --- scripts/s_group_color.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 scripts/s_group_color.lua (limited to 'scripts') diff --git a/scripts/s_group_color.lua b/scripts/s_group_color.lua new file mode 100644 index 0000000000..1fd5321ef5 --- /dev/null +++ b/scripts/s_group_color.lua @@ -0,0 +1,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 -- cgit v1.2.3