Add stencil on color
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
PixeeBox/resgen.swift/pipeline/head There was a failure building this commit

This commit is contained in:
2023-12-15 09:49:11 +01:00
parent eed20367b9
commit 3f64e9682c
12 changed files with 163 additions and 27 deletions

View File

View File

@ -0,0 +1,21 @@
// Generated by ResgenSwift.{{ toolName }} {{ resgenVersion }}
{% if isSwiftUI %}
import SwiftUI
{% else %}
import UIKit
{% endif %}
extension {{ extensionClassname }} {
{% for color in colors %}
{% if isSwiftUI %}
/// Color {{ color.name }} is {{ color.light }} {{ color.light }} or {{ color.dark }} {{ color.dark }}"
{% if isStatic %}static {% endif %}var {{ color.name }}: Color {
Color("{{ color.name }}")
}
{% else %}
/// Color {{ color.name }} is {{ color.light }} {{ color.light }} or {{ color.dark }} {{ color.dark }}"
{% if isStatic %}static {% else %}@objc {% endif %}var {{ color.name }}: UIColor {
UIColor(named: "{{ color.name }}")!
}
{% endif %}
{% endfor %}
}

View File

@ -0,0 +1,4 @@
/// Color {{ color.name }} is {{ color.light }} {{ color.light }} or {{ color.dark }} {{ color.dark }}"
{% if isStatic %}static {% endif %}var {{ color.name }}: Color {
Color("{{ color.name }}")
}

View File

@ -0,0 +1,4 @@
/// Color {{ color.name }} is {{ color.light }} {{ color.light }} or {{ color.dark }} {{ color.dark }}"
{% if isStatic %}static {% else %}@objc {% endif %}var {{ color.name }}: UIColor {
UIColor(named: "{{ color.name }}")!
}