From 9b02b229c9ea5ce86c870b2e05f48c23d6866673 Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Wed, 15 Feb 2023 23:20:00 +0000 Subject: [PATCH] Colour Theory * Apply colour theory to colour randomisation. --- game/scripts/wardrobe/wardrobe.rpy | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/game/scripts/wardrobe/wardrobe.rpy b/game/scripts/wardrobe/wardrobe.rpy index 65f65291..f4a139f2 100644 --- a/game/scripts/wardrobe/wardrobe.rpy +++ b/game/scripts/wardrobe/wardrobe.rpy @@ -306,6 +306,19 @@ label wardrobe_menu(): progress = get_character_progression(active_girl) + if wardrobe_randomise_color: + + tetriadic_colors = [Color("%06x" % random.randint(0, 0xFFFFFF))] + triadic_colors = [tetriadic_colors[0].rotate_hue(0.25)] + double_colors = [tetriadic_colors[0], tetriadic_colors[0].rotate_hue(0.5)] + + for i in range(1, 3): + col = tetriadic_colors[0].rotate_hue((i * 90.0) / 360.0) + tetriadic_colors.append(col) + + col = triadic_colors[i-1].rotate_hue((i * 75.0) / 360.0) + triadic_colors.append(col) + for k in dict(char_active.states).keys(): valid_choices = [x for x in char_active.wardrobe_list if (istype(x, (DollCloth, DollClothDynamic, DollMakeup)) and x.type == k and x.unlocked and progress >= x.level)] @@ -343,10 +356,21 @@ label wardrobe_menu(): if not cloth is None: if wardrobe_randomise_color and cloth.color: + col_len = len(cloth.color) col = [] - for i in range(len(cloth.color)): - col.append([random.randint(0, 255), random.randint(0, 255), random.randint(0, 255), 255]) + for i in range(col_len): + if col_len == 1: + col.append(tetriadic_colors[0]) + elif col_len == 2: + col.append(double_colors[i-1]) + elif col_len == 3: + col.append(triadic_colors[i-1]) + else: + try: + col.append(tetriadic_colors[i-1]) + except: + col.append(col[-1].rotate_hue(0.33)) cloth.set_color(col)