#https://www.shadertoy.com/view/ldfyzf

pixels = W:1024 H:1024

x = from -128 to 128 W
y = from -128 to 128 H

period =6* PI
x = sin(x / period) * period
y = sin(y / period) * period
t = 0.01

power = 8
red   = pow_sign(sin((x*x+y*y)*t),power)
green = pow_sign(sin((2.0*x*y)*t),power)
blue  = pow_sign(sin((x*x-y*y)*t),power)
avg = (red + blue + green) / 3.0
mute = 0.9

rx = if(red>0, red, 0)
ry = if(red>0, 0, -red * mute)
rz = if(red>0, 0, -red * mute)

gx = if(green>0, 0, -green * mute)
gy = if(green>0, green, 0)
gz = if(green>0, 0, -green * mute)

bx = if(blue>0, 0, -blue * mute)
by = if(blue>0, 0, -blue * mute)
bz = if(blue>0, blue, 0)

r = max(rx, max(gx, bx))
g = max(ry, max(gy, by))
b = max(rz, max(gz, bz))
