Add stencil on color
This commit is contained in:
0
Templates/Colors/json_template
Normal file
0
Templates/Colors/json_template
Normal file
21
Templates/Colors/main_template
Normal file
21
Templates/Colors/main_template
Normal 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 %}
|
||||
}
|
4
Templates/Colors/swiftui_template
Normal file
4
Templates/Colors/swiftui_template
Normal 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 }}")
|
||||
}
|
4
Templates/Colors/uikit_template
Normal file
4
Templates/Colors/uikit_template
Normal 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 }}")!
|
||||
}
|
Reference in New Issue
Block a user