From b86f0f92170766fe7931042d25bf2961dfaccb3c Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Sat, 8 Apr 2023 09:11:38 +0200 Subject: [PATCH] Got some sleep --- src/window.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 7bbcade..bbe3786 100644 --- a/src/window.py +++ b/src/window.py @@ -328,9 +328,11 @@ class CartridgesWindow(Adw.ApplicationWindow): luminance = red * 0.2126 + green * 0.7152 + blue * 0.0722 if dark_theme: - luminances.append((luminance * alpha) / 255**2) + luminances.append((luminance * (alpha / 255)) / 255) else: - luminances.append(1 - (alpha / 255) * (1 - luminance / 255)) + luminances.append( + (luminance + (255 - luminance) * ((255 - alpha) / 255)) / 255 + ) if dark_theme: self.overview_blurred_cover.set_opacity( @@ -340,6 +342,7 @@ class CartridgesWindow(Adw.ApplicationWindow): self.overview_blurred_cover.set_opacity( 0.2 + (sum(luminances) / len(luminances) + min(luminances)) / 2 ) + print(sum(luminances) / len(luminances)) def a_z_sort(self, child1, child2): name1 = child1.get_first_child().name.lower()