Formatting
This commit is contained in:
parent
8f7d4b9278
commit
8c2606b60b
1 changed files with 30 additions and 15 deletions
|
@ -29,8 +29,15 @@ colour_diffs = tuple(map(lambda x: x[1] - x[0], zip(highest_colour, lowest_colou
|
|||
|
||||
def get_colour_for(n):
|
||||
return tuple(
|
||||
map(int, map(lambda x: x[0] - x[1], zip(lowest_colour, map(lambda x: x * n, colour_diffs))))
|
||||
map(
|
||||
int,
|
||||
map(
|
||||
lambda x: x[0] - x[1],
|
||||
zip(lowest_colour, map(lambda x: x * n, colour_diffs)),
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
scale_factor = 8
|
||||
|
||||
|
@ -52,7 +59,9 @@ def generate_frame(i, base_img, highlight_locs, hc, sequence) -> int:
|
|||
img.putpixel(h, hc)
|
||||
|
||||
maxx, maxy = img.size
|
||||
img = img.resize((maxx * scale_factor, maxy * scale_factor), resample=Image.NEAREST)
|
||||
img = img.resize(
|
||||
(maxx * scale_factor, maxy * scale_factor), resample=Image.NEAREST
|
||||
)
|
||||
img.save(f"frames/{str(i).zfill(5)}.png")
|
||||
i += 1
|
||||
return i
|
||||
|
@ -102,5 +111,11 @@ if __name__ == "__main__":
|
|||
x_cursor += diff.x
|
||||
y_cursor += diff.y
|
||||
|
||||
i = generate_frame(i, base_img, (a, b), get_highlight_for(ns.index(antenna_type) / nns), this_iter)
|
||||
i = generate_frame(
|
||||
i,
|
||||
base_img,
|
||||
(a, b),
|
||||
get_highlight_for(ns.index(antenna_type) / nns),
|
||||
this_iter,
|
||||
)
|
||||
update_base(base_img, this_iter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue