From f5c5e3169122172001e9557b5b2be460b1c8fae7 Mon Sep 17 00:00:00 2001 From: thea Date: Fri, 10 Oct 2025 14:46:41 +1000 Subject: [PATCH] [F] Fix 3-length hex codes in Python when using custom preset (#443) [F] Fix 3-length hex codes in Python --- hyfetch/color_util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hyfetch/color_util.py b/hyfetch/color_util.py index 2ca4f22d..42e02d7d 100644 --- a/hyfetch/color_util.py +++ b/hyfetch/color_util.py @@ -141,9 +141,9 @@ class RGB: g = int(hex[2:4], 16) b = int(hex[4:6], 16) elif len(hex) == 3: - r = int(hex[0], 16) - g = int(hex[1], 16) - b = int(hex[2], 16) + r = int(hex[0] * 2, 16) + g = int(hex[1] * 2, 16) + b = int(hex[2] * 2, 16) else: raise ValueError(f"Error: invalid hex length") return cls(r, g, b)