Smoother colors in sinic*.py
This commit is contained in:
parent
09d90b6479
commit
c668de99e5
10
sinic.py
10
sinic.py
@ -33,11 +33,11 @@ x, y = np.meshgrid(
|
|||||||
|
|
||||||
img = np.zeros( [Ny, Nx, 3] )
|
img = np.zeros( [Ny, Nx, 3] )
|
||||||
|
|
||||||
Sa = Slider(-3, 3, 0.01, -0.5)
|
Sa = Slider(-3, 3, 0.01, np.random.uniform(-1, 1))
|
||||||
Sb = Slider(-3, 3, 0.01, 0.5)
|
Sb = Slider(-3, 3, 0.01, np.random.uniform(-1, 1))
|
||||||
Sc = Slider(0, 1, 0.005, 0)
|
Sc = Slider(0, 1, 0.005, np.random.uniform(-1, 1))
|
||||||
|
|
||||||
Scolor = Slider(0, 1, 0.01/iterations, 0)
|
Scolor = Slider(0, 1, 0.001/iterations, 0)
|
||||||
|
|
||||||
step = 0
|
step = 0
|
||||||
while True:
|
while True:
|
||||||
@ -49,7 +49,7 @@ while True:
|
|||||||
Sb.pos += c*0.001
|
Sb.pos += c*0.001
|
||||||
Sc.pos += a*0.001
|
Sc.pos += a*0.001
|
||||||
|
|
||||||
curve = 1*(np.sin(c) + np.sin(np.sin(a*x) + np.cos(b*y)) - np.cos(np.sin(b*x*y) + np.cos(b*x)) <= 0.1)
|
curve = (np.clip(np.sin(c) + np.sin(np.sin(a*x) + np.cos(b*y)) - np.cos(np.sin(b*x*y) + np.cos(b*x)), 0, 1))
|
||||||
|
|
||||||
cr, cg, cb = colorsys.hsv_to_rgb(Scolor.step(), 1, 1)
|
cr, cg, cb = colorsys.hsv_to_rgb(Scolor.step(), 1, 1)
|
||||||
|
|
||||||
|
11
sinic2.py
11
sinic2.py
@ -33,11 +33,12 @@ x, y = np.meshgrid(
|
|||||||
|
|
||||||
img = np.zeros( [Ny, Nx, 3] )
|
img = np.zeros( [Ny, Nx, 3] )
|
||||||
|
|
||||||
Sa = Slider(-3, 3, 0.01, -0.5)
|
Sa = Slider(-3, 3, 0.01, np.random.uniform(-1, 1))
|
||||||
Sb = Slider(-3, 3, 0.01, 0.5)
|
Sb = Slider(-3, 3, 0.01, np.random.uniform(-1, 1))
|
||||||
Sc = Slider(0, 1, 0.005, 0)
|
Sc = Slider(0, 1, 0.005, np.random.uniform(-1, 1))
|
||||||
|
|
||||||
|
Scolor = Slider(0, 1, 0.001/iterations, 0)
|
||||||
|
|
||||||
Scolor = Slider(0, 1, 0.01/iterations, 0)
|
|
||||||
|
|
||||||
step = 0
|
step = 0
|
||||||
while True:
|
while True:
|
||||||
@ -49,7 +50,7 @@ while True:
|
|||||||
Sb.pos += c*0.001
|
Sb.pos += c*0.001
|
||||||
Sc.pos += a*0.001
|
Sc.pos += a*0.001
|
||||||
|
|
||||||
curve = 1*(c+np.sin(a*x*x-b*y*y)-np.sin(a*x+b*y)-np.cos(a*b*x*y) <= 0.1)
|
curve = np.clip(c+np.sin(a*x*x-b*y*y)-np.sin(a*x+b*y)-np.cos(a*b*x*y), 0, 1)
|
||||||
|
|
||||||
cr, cg, cb = colorsys.hsv_to_rgb(Scolor.step(), 1, 1)
|
cr, cg, cb = colorsys.hsv_to_rgb(Scolor.step(), 1, 1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user