HUD Gradient Change

I was hoping someone can help me with having my HUD change gradiently from one template to another. Like this:

As x variable increases, the HUD will change from template 1 to template 2. Then as the x variable gets even larger, the HUD will change from template 2 to template 3, etc.

Thanks

Guess along the lines of psuedocode:

if xVar <template2max then
change colour of screen towards template 2
end
else if xVar >template2max and xVar <template3max then
change colour of screen towards template 3
end
else if xVar >template3max and xVar <template4max then
change colour of screen towards template 4
end
[…]

For the changing of the colour I’d use x variable as a factor e.g.
[lua]
tab= {}
tab[ “$pp_colour_addr” ] = 0
tab[ “$pp_colour_addg” ] = 0
tab[ “$pp_colour_addb” ] = 0
tab[ “$pp_colour_brightness” ] = 0
tab[ “$pp_colour_contrast” ] = 1
tab[ “$pp_colour_colour” ] = 1
tab[ “$pp_colour_mulr” ] = 0
tab[ “$pp_colour_mulg” ] = 0
tab[ “$pp_colour_mulb” ] = 0

tab[ “$pp_colour_addr” ] = xVar
– or tab[ “$pp_colour_addr” ] = xVar*5 or something

function Screen ()
DrawColorModify(tab)
end

hook.Add(“RenderScreenspaceEffects”,“Screen”,Screen)
[/lua]

Can you explain that a little more? I don’t really see what you’re doing there.

The psuedocode or the part below?

The part below. I don’t really get what you’re doing with the table and stuff.

[lua]
function blah(var)
local rate = var / 10 --Let’s say your value goes up each time by 10
local tlist = {“foo”, “bar”, “hobo”, “green”} --list of template
return tlist[rate]
end
[/lua]

The $pp refers to post processes which can be used to edit what screen effects are present.

The table just holds all of the data that it needs to render the screen effects and editing the values (the first lot of values with initialization are default) will edit what screen effects are created.