Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bnidevs authored Jan 23, 2022
1 parent d016663 commit 5d965bc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ def variate(rgb_tup, bottom, top):
def check_in(x, y, rad, centerx=500, centery=250):
return ((x-centerx)**2 + (y-centery)**2) < (rad**2)

def check_ring(x, y, radx, rady, ring_width):
def check_ring(x, y, radx, rady, ring_width, ring_angle):
inner_ring_x = (min(200,radx-ring_width)) if not ring_angle else radx-ring_width
inner_ring_y = (min(200,rady-ring_width)) if ring_angle else rady-ring_width
inside_outer_ring = (((x-500)**2) / (radx**2) + ((y-250)**2) / (rady**2)) < 1
inside_inner_ring = (((x-500)**2) / ((min(200,radx-ring_width))**2) + ((y-250)**2) / ((min(200,rady-ring_width))**2)) < 1
inside_inner_ring = (((x-500)**2) / (inner_ring_x**2) + ((y-250)**2) / (inner_ring_y**2)) < 1
return inside_outer_ring and (not inside_inner_ring)

while s_in != 'qqq':
Expand Down Expand Up @@ -219,7 +221,7 @@ def check_ring(x, y, radx, rady, ring_width):
print('decide ring ... done')

if ring_bool:
ring_angle = int(keyed_hash[-5], 16) > 7
ring_angle = False #int(keyed_hash[-5], 16) > 7
ring_vert_size = int(keyed_hash[47], 16) * 5 + 64
ring_hori_size = int(keyed_hash[48], 16) * 10 + 200

Expand All @@ -231,7 +233,7 @@ def check_ring(x, y, radx, rady, ring_width):

for j in range(500):
for i in range(1000):
if check_ring(i, j, ring_hori_size, ring_vert_size, ring_width):
if check_ring(i, j, ring_hori_size, ring_vert_size, ring_width, ring_angle):
if not ring_angle:
if j < 250:
if pixel_map[i,j] not in colors_so_far:
Expand Down

0 comments on commit 5d965bc

Please sign in to comment.