X-Git-Url: https://git.sesse.net/?p=nageru;a=blobdiff_plain;f=simple.lua;h=2bff8f341a09387f643d92bc397b14b1d92ea501;hp=1e895d5cb69f7a236b6932b5846b7f95e721104d;hb=703e00da89118df9be0354dda621bed023e6030e;hpb=fc92430551c5a5f7787db62bc42d5192610859b4 diff --git a/simple.lua b/simple.lua index 1e895d5..2bff8f3 100644 --- a/simple.lua +++ b/simple.lua @@ -77,6 +77,15 @@ function channel_signal(channel) end end +-- API ENTRY POINT +-- Called every frame. Returns the color (if any) to paint around the given +-- channel. Returns a CSS color (typically to mark live and preview signals); +-- "transparent" is allowed. +-- Will never be called for live (0) or preview (1). +function channel_color(channel) + return "transparent" +end + -- API ENTRY POINT -- Returns if a given channel supports setting white balance (starting from 2). -- Called only once for each channel, at the start of the program. @@ -157,9 +166,13 @@ function get_chain(num, t, width, height, signals) signal_num = num - 2 end - prepare = function() + -- Make a copy of the current neutral color before returning, so that the + -- returned prepare function is unaffected by state changes made by the UI + -- before it is rendered. + local color = input_neutral_color[signal_num + 1] + + local prepare = function() chain.input:connect_signal(signal_num) - local color = input_neutral_color[signal_num + 1] chain.wb_effect:set_vec3("neutral_color", color[1], color[2], color[3]) end return chain.chain, prepare