Skip to content

Commit

Permalink
Merge pull request #46 from marcos-vinicius-mafei/main
Browse files Browse the repository at this point in the history
fix: transparent image background;
  • Loading branch information
maxxfrazer authored Feb 22, 2024
2 parents f12c080 + 22e7286 commit 5fa5211
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Sources/FocusEntity/FocusEntity+Colored.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 = UnlitMaterial()
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
Expand Down

0 comments on commit 5fa5211

Please sign in to comment.