Génération de composant SwiftUI: Color et Image
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit

This commit is contained in:
2022-10-31 16:21:32 +01:00
parent 0797667b25
commit 4f7d7e18b1
13 changed files with 258 additions and 11 deletions

View File

@ -72,6 +72,8 @@ struct ParsedColor {
"""
}
// MARK: - UIKit
func getColorProperty() -> String {
"""
/// Color \(name) is \(light) (light) or \(dark) (dark)"
@ -89,4 +91,24 @@ struct ParsedColor {
}
"""
}
// MARK: - SwiftUI
func getSUIColorProperty() -> String {
"""
/// Color \(name) is \(light) (light) or \(dark) (dark)"
var \(name): Color {
Color("\(name)")
}
"""
}
func getSUIColorStaticProperty() -> String {
"""
/// Color \(name) is \(light) (light) or \(dark) (dark)"
static var \(name): Color {
Color("\(name)")!
}
"""
}
}