improve code style
This commit is contained in:
@@ -31,7 +31,7 @@ extension PHTheme {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Load the bundled theme.
|
/// Load the bundled theme.
|
||||||
/// If the theme doesn't exist or fails to parse, the execution is interrupted.
|
/// If the file doesn't exist or fails to parse, the execution is interrupted.
|
||||||
static private func loadFromBundle() throws -> PHTheme {
|
static private func loadFromBundle() throws -> PHTheme {
|
||||||
guard
|
guard
|
||||||
let defaultConfig = Bundle.module.url(
|
let defaultConfig = Bundle.module.url(
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ import SwiftUI
|
|||||||
struct PHThemeColor: Decodable, ShapeStyle {
|
struct PHThemeColor: Decodable, ShapeStyle {
|
||||||
typealias Resolved = SwiftUI.Color
|
typealias Resolved = SwiftUI.Color
|
||||||
|
|
||||||
let color: String
|
let color: String
|
||||||
let alpha: Double?
|
let alpha: Double?
|
||||||
|
|
||||||
var uiColor: SwiftUI.Color {
|
var uiColor: SwiftUI.Color {
|
||||||
SwiftUI.Color(hex: color, opacity: alpha)
|
SwiftUI.Color(hex: color, opacity: alpha)
|
||||||
}
|
}
|
||||||
|
|
||||||
var nsColor: NSColor? {
|
var nsColor: NSColor? {
|
||||||
guard let cgColor else { return nil }
|
guard let cgColor else { return nil }
|
||||||
|
|||||||
Reference in New Issue
Block a user