-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrash.swift
More file actions
27 lines (24 loc) · 796 Bytes
/
Copy pathTrash.swift
File metadata and controls
27 lines (24 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import SwiftUI
import TemplateSupport
/// Make grayscale and overlay a red trash icon.
struct Trash: IconTemplate, PreviewProvider {
let icon: NSImage
// Mark this template as not needing any additional content
typealias Content = Never
// Expect size to be 1024x1024
var body: some View {
Image(nsImage: icon)
.resizable()
.scaledToFit()
.grayscale(1)
.overlay(alignment: .center) {
Image(systemName: "trash")
.resizable()
.scaledToFit()
.symbolVariant(.circle.fill)
.symbolRenderingMode(.hierarchical)
.foregroundColor(.red)
.frame(width: 384, height: 384)
}
}
}