From e14f5a7f483e873f55cadf9a2d43cfe3887fa9ec Mon Sep 17 00:00:00 2001 From: Thibaut Schmitt Date: Wed, 22 Dec 2021 10:33:32 +0100 Subject: [PATCH] Add script to generate all ressources --- .../Generated/UIColor+ColorGenAllScript.swift | 21 +++++++++++++++++++ .../blue_light_dark.colorset/Contents.json | 2 +- SampleFiles/genAllRessources.sh | 7 +++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 SampleFiles/Colors/Generated/UIColor+ColorGenAllScript.swift create mode 100755 SampleFiles/genAllRessources.sh diff --git a/SampleFiles/Colors/Generated/UIColor+ColorGenAllScript.swift b/SampleFiles/Colors/Generated/UIColor+ColorGenAllScript.swift new file mode 100644 index 0000000..6d934e1 --- /dev/null +++ b/SampleFiles/Colors/Generated/UIColor+ColorGenAllScript.swift @@ -0,0 +1,21 @@ +// Generated from ColorToolCore at 2021-12-22 09:32:10 +0000 + +import UIKit + +extension UIColor { + + /// Color red is #FF0000 (light) or #FF0000 (dark)" + static var red: UIColor { + UIColor(named: "red")! + } + + /// Color green_alpha_50 is #A000FF00 (light) or #A000FF00 (dark)" + static var green_alpha_50: UIColor { + UIColor(named: "green_alpha_50")! + } + + /// Color blue_light_dark is #0000FF (light) or #0000AA (dark)" + static var blue_light_dark: UIColor { + UIColor(named: "blue_light_dark")! + } +} \ No newline at end of file diff --git a/SampleFiles/Colors/colors.xcassets/Colors/blue_light_dark.colorset/Contents.json b/SampleFiles/Colors/colors.xcassets/Colors/blue_light_dark.colorset/Contents.json index 830f655..5e6e60d 100644 --- a/SampleFiles/Colors/colors.xcassets/Colors/blue_light_dark.colorset/Contents.json +++ b/SampleFiles/Colors/colors.xcassets/Colors/blue_light_dark.colorset/Contents.json @@ -23,7 +23,7 @@ "color-space": "srgb", "components": { "alpha": "0xFF", - "blue": "0xFF", + "blue": "0xAA", "green": "0x00", "red": "0x00", } diff --git a/SampleFiles/genAllRessources.sh b/SampleFiles/genAllRessources.sh new file mode 100755 index 0000000..8415a27 --- /dev/null +++ b/SampleFiles/genAllRessources.sh @@ -0,0 +1,7 @@ +#/bin/bash + +# Font +swift run -c release FontToolCore ./Fonts --extension-output-path ./Fonts/Generated --extension-name R2Font + +# Color +swift run -c release ColorToolCore ./Colors/sampleColors1.txt --style all --xcassets-path "./Colors/colors.xcassets" --extension-output-path "./Colors/Generated/" --extension-name "UIColor" --extension-suffix "GenAllScript"