diff options
author | Robin Gareus <robin@gareus.org> | 2017-05-03 17:47:16 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-05-03 17:53:00 +0200 |
commit | a55fb928a7f8c2af5ce71ff0b8cb5a1006f4011d (patch) | |
tree | 2225ef9d52d9b010c1bd05697ecc3cc768546934 /scripts | |
parent | 0b189a576670a49693331e00ad8e8626f5826af7 (diff) |
Lua bindings to set group color
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/s_group_color.lua | 11 |
1 files changed, 11 insertions, 0 deletions
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 |