Mods
This commit is contained in:
parent
0e2dfa7a3a
commit
a8be025870
|
@ -76,7 +76,7 @@ class Ants:
|
||||||
ant.created = now
|
ant.created = now
|
||||||
ant.updated = now
|
ant.updated = now
|
||||||
ant.name = Utils.random_name()
|
ant.name = Utils.random_name()
|
||||||
ant.color = Utils.random_color()
|
ant.color = Utils.random_color(ant.name)
|
||||||
|
|
||||||
Ants.ants.append(ant)
|
Ants.ants.append(ant)
|
||||||
image_path = Config.hatched_image_path
|
image_path = Config.hatched_image_path
|
||||||
|
|
|
@ -68,7 +68,10 @@ class Utils:
|
||||||
print(text) # noqa: T201
|
print(text) # noqa: T201
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def random_color() -> tuple[int, int, int]:
|
def random_color(seed: str) -> tuple[int, int, int]:
|
||||||
|
seed_int = hash(seed)
|
||||||
|
random.seed(seed_int)
|
||||||
|
|
||||||
h, s, l = (
|
h, s, l = (
|
||||||
random.random(),
|
random.random(),
|
||||||
0.5 + random.random() / 2.0,
|
0.5 + random.random() / 2.0,
|
||||||
|
|
Loading…
Reference in New Issue