-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathShadow.swift
47 lines (40 loc) · 1.1 KB
/
Shadow.swift
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// Shadow.swift
// Popovers
//
// Created by A. Zheng (github.com/aheze) on 2/4/22.
// Copyright © 2022 A. Zheng. All rights reserved.
//
#if os(iOS)
import SwiftUI
public extension Templates {
/// A convenient way to apply shadows. Access using the `.popoverShadow()` modifier.
struct Shadow {
/// The shadow color.
public var color = Color.black.opacity(0.25)
/// The shadow radius.
public var radius = CGFloat(0)
/// The shadow's x offset.
public var x = CGFloat(0)
/// The shadow's y offset.
public var y = CGFloat(0)
public static var system = Self(
color: Color.black.opacity(0.25),
radius: 40,
x: 0,
y: 4
)
public init(
color: Color = Color.black.opacity(0.25),
radius: CGFloat = CGFloat(0),
x: CGFloat = CGFloat(0),
y: CGFloat = CGFloat(0)
) {
self.color = color
self.radius = radius
self.x = x
self.y = y
}
}
}
#endif