scheme: impl random + fix single schemes

This commit is contained in:
2 * r + 2 * t
2025-06-12 16:00:43 +10:00
parent 194826efaa
commit 672ef4a2d9
6 changed files with 10 additions and 1 deletions
+8
View File
@@ -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