From 17645e5ec7bd46fdeb0fa038a2639ebbc226fa7b Mon Sep 17 00:00:00 2001 From: marcos Date: Wed, 14 Feb 2024 17:27:28 -0300 Subject: [PATCH 1/2] fix: transparent image backgrounds --- Sources/FocusEntity/FocusEntity+Colored.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/FocusEntity/FocusEntity+Colored.swift b/Sources/FocusEntity/FocusEntity+Colored.swift index 6053dfe..9be4ec1 100644 --- a/Sources/FocusEntity/FocusEntity+Colored.swift +++ b/Sources/FocusEntity/FocusEntity+Colored.swift @@ -26,17 +26,19 @@ public extension FocusEntity { } var modelMaterial: Material! if #available(iOS 15, macOS 12, *) { - var mat = PhysicallyBasedMaterial() switch endColor { case .color(let uikitColour): + var mat = PhysicallyBasedMaterial() mat.baseColor = .init(tint: .black.withAlphaComponent(uikitColour.cgColor.alpha)) mat.emissiveColor = .init(color: uikitColour) mat.emissiveIntensity = 2 + modelMaterial = mat case .texture(let tex): - mat.baseColor = .init(tint: .white.withAlphaComponent(0.9999), texture: .init(tex)) + var mat = SimpleMaterial() + mat.color = .init(tint: .white.withAlphaComponent(0.9999), texture: .init(tex)) + modelMaterial = mat @unknown default: break } - modelMaterial = mat } else { var mat = UnlitMaterial(color: .clear) mat.baseColor = endColor From 22e72867c945e72f0892d98a7c147c388666132a Mon Sep 17 00:00:00 2001 From: marcos Date: Wed, 14 Feb 2024 17:42:55 -0300 Subject: [PATCH 2/2] fix: glassy rectangle --- Sources/FocusEntity/FocusEntity+Colored.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/FocusEntity/FocusEntity+Colored.swift b/Sources/FocusEntity/FocusEntity+Colored.swift index 9be4ec1..e39f164 100644 --- a/Sources/FocusEntity/FocusEntity+Colored.swift +++ b/Sources/FocusEntity/FocusEntity+Colored.swift @@ -34,7 +34,7 @@ public extension FocusEntity { mat.emissiveIntensity = 2 modelMaterial = mat case .texture(let tex): - var mat = SimpleMaterial() + var mat = UnlitMaterial() mat.color = .init(tint: .white.withAlphaComponent(0.9999), texture: .init(tex)) modelMaterial = mat @unknown default: break