diff options
Diffstat (limited to 'src/caelestia/utils')
| -rwxr-xr-x | src/caelestia/utils/material/generator.py | 2 | ||||
| -rw-r--r-- | src/caelestia/utils/scheme.py | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/caelestia/utils/material/generator.py b/src/caelestia/utils/material/generator.py index 33ff0e8..235b2ce 100755 --- a/src/caelestia/utils/material/generator.py +++ b/src/caelestia/utils/material/generator.py @@ -187,6 +187,6 @@ def gen_scheme(scheme, primary: Hct, colours: list[Hct]) -> dict[str, str]: colours["success"] = harmonize(base[8], primary) # For debugging - print("\n".join(["{}: \x1b[48;2;{};{};{}m \x1b[0m".format(n, *c.to_rgba()[:3]) for n, c in colours.items()])) + # print("\n".join(["{}: \x1b[48;2;{};{};{}m \x1b[0m".format(n, *c.to_rgba()[:3]) for n, c in colours.items()])) return {k: hex(v.to_int())[4:] for k, v in colours.items()} diff --git a/src/caelestia/utils/scheme.py b/src/caelestia/utils/scheme.py index 66cd697..ce8d6fe 100644 --- a/src/caelestia/utils/scheme.py +++ b/src/caelestia/utils/scheme.py @@ -1,4 +1,5 @@ import json +import random from pathlib import Path from caelestia.utils.material import get_colours_for_image @@ -106,6 +107,13 @@ class Scheme: f, ) + def set_random(self) -> None: + self._name = random.choice(get_scheme_names()) + self._flavour = random.choice(get_scheme_flavours()) + self._mode = random.choice(get_scheme_modes()) + self._update_colours() + self.save() + def _check_flavour(self) -> None: global scheme_flavours scheme_flavours = None |