Example ====== Create a mixed colour palette (Snippet) ====== ^ by: | Alex del Bondio, January 2019 | ^ published: | http://forum.avolites.com/viewtopic.php?f=20&t=5991 | ^ description: | create a mixed colour palette based on groups and palettes | ^ remarks: | idea/request by Michiel3000 | {{tag>create colour palette}} **From Titan v15 on ClearAll() requires two parameters, see [[macros:function:programmer.editor.clearall|]].\\ Simply change the relevant line(s) to ''Programmer.Editor.ClearAll(false, false)''.** ==== functions ==== * [[:macros:function:Programmer.Editor.ClearAll]] * [[:macros:function:Group.RecallGroupNumeric]] * [[:macros:function:Palette.ApplyPalette]] * [[:macros:function:ActionScript.SetProperty]] * [[:macros:function:Palette.StoreCurrentPaletteReplace]] ==== affected properties ==== * [[:macros:property:Palette.CurrentPaletteHandle]] ===== Code ===== Programmer.Editor.ClearAll() Group.RecallGroupNumeric(101) Palette.ApplyPalette("paletteHandleUN=100", false) Group.RecallGroupNumeric(102) Palette.ApplyPalette("paletteHandleUN=100", false) Group.RecallGroupNumeric(103) Palette.ApplyPalette("paletteHandleUN=101", false) ActionScript.SetProperty("Palette.CurrentPaletteHandle", handle:"paletteHandleUN=113") Palette.StoreCurrentPaletteReplace() Programmer.Editor.ClearAll() ===== Explanation ===== This explains the functional steps within the sequence. For all the other XML details please refer to [[:macros:formats_and_syntax#xml_format|Formats and syntax]] * ''Programmer.Editor.ClearAll'' ensure the editor is empty * one by one various groups are called and a palette is applied: * ''Group.RecallGroupNumeric'' selects a group * ''Palette.ApplyPalette'' applies a palette to the fixtures in this group * ''ActionScript.SetProperty("Palette.CurrentPaletteHandle", handle:...)'' selects the palette where the result is to be stored * ''Palette.StoreCurrentPaletteReplace'' stores/replaces the target palette * a final ''Programmer.Editor.ClearAll'' clears the editor again **Note that the target palette needs to be recorded as normal palette in the first place else this would store only the last colour information as shared or global.** ===== How to use it ===== This is a snippet only - adapt and use it in your own macros. ~~DISCUSSION~~