From 04e60abc1414768313ccbede93c366523398db74 Mon Sep 17 00:00:00 2001 From: Jah-yee <166608075+Jah-yee@users.noreply.github.com> Date: Sun, 7 Jun 2026 01:44:20 +0800 Subject: [PATCH] fix(BezelNotification): handle non-RGB colorspace for background tint alpha When rawBackgroundTint is not in an RGB colorspace, getRed() returns false and the alpha parameter is left unmodified (zero), making the tint fully-transparent. Use alphaComponent as a fallback for non-RGB colorspaces so that tint works correctly regardless of the source color's colorspace. Fixes #28 --- .../Howl/Configuration/BezelNotificationParameters.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/Howl/Configuration/BezelNotificationParameters.swift b/Sources/Howl/Configuration/BezelNotificationParameters.swift index a252ac1..2ba865f 100644 --- a/Sources/Howl/Configuration/BezelNotificationParameters.swift +++ b/Sources/Howl/Configuration/BezelNotificationParameters.swift @@ -240,7 +240,11 @@ public extension BezelNotificationParameters { #if canImport(AppKit) rawBackgroundTintAlpha = rawBackgroundTint.alphaComponent #else - rawBackgroundTint.getRed(nil, green: nil, blue: nil, alpha: &rawBackgroundTintAlpha) + var alpha: CGFloat = 0 + if !rawBackgroundTint.getRed(nil, green: nil, blue: nil, alpha: &alpha) { + alpha = rawBackgroundTint.alphaComponent + } + rawBackgroundTintAlpha = alpha #endif return rawBackgroundTint.withAlphaComponent(rawBackgroundTintAlpha * 0.15)