From 066ee8342f22480dbcc700d2b8b80d270da11207 Mon Sep 17 00:00:00 2001 From: Jordan Thompson Date: Thu, 28 Sep 2023 12:15:45 -0700 Subject: [PATCH] Update WAS_Node_Suite.py --- WAS_Node_Suite.py | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/WAS_Node_Suite.py b/WAS_Node_Suite.py index 2235288..4b30b3f 100644 --- a/WAS_Node_Suite.py +++ b/WAS_Node_Suite.py @@ -5692,34 +5692,18 @@ class WAS_Remove_Rembg: # Set bgcolor bgrgba = None - # Use faster match for 3.10+ python - if p310_plus: - match background_color: - case "black": - bgrgba = [0, 0, 0, 255] - case "white": - bgrgba = [255, 255, 255, 255] - case "magenta": - bgrgba = [255, 0, 255, 255] - case "chroma green": - bgrgba = [0, 177, 64, 255] - case "chroma blue": - bgrgba = [0, 71, 187, 255] - case _: - bgrgba = None + if background_color == "black": + bgrgba = [0, 0, 0, 255] + elif background_color == "white": + bgrgba = [255, 255, 255, 255] + elif background_color == "magenta": + bgrgba = [255, 0, 255, 255] + elif background_color == "chroma green": + bgrgba = [0, 177, 64, 255] + elif background_color == "chroma blue": + bgrgba = [0, 71, 187, 255] else: - if background_color == "black": - bgrgba = [0, 0, 0, 255] - elif background_color == "white": - bgrgba = [255, 255, 255, 255] - elif background_color == "magenta": - bgrgba = [255, 0, 255, 255] - elif background_color == "chroma green": - bgrgba = [0, 177, 64, 255] - elif background_color == "chroma blue": - bgrgba = [0, 71, 187, 255] - else: - bgrgba = None + bgrgba = None if transparency and bgrgba is not None: bgrgba[3] = 0