Color Flash

How would i go abouts making a players screen fade into a a color very quickly, then back out, and i mean rreeeealy quickly, like 0.5 seconds quick.

Like to induce epilepsy? We’ll pass.

[lua]
local alpha,rising,color = 0,true,Color(255,0,0,0)
hook.Add(“HUDPaint”,“fjdksla”,function()
if alpha == 255 then rising = false
elseif alpha == 0 then rising = true end

if rising then alpha = math.Approach(alpha,255,1)
else alpha = math.Approach(alpha,0,-1) end

color.a = alpha
draw.RoundedBox(0,0,0,ScrW(),ScrH(),color)

end)[/lua]

Change the third argument to math.Approach to make this go faster/slower.

Thankyou Entoros.