//
//  File.swift
//
//
//  Created by Akash Bhardwaj on 20/06/20.
//

import Foundation
struct GlobalTokenConstants {
    struct Color {
        static let hexToColorExtension = """
        extension UIColor {
            public convenience init?(hex: String) {
                let r, g, b, a: CGFloat

                if hex.hasPrefix("#") {
                    let start = hex.index(hex.startIndex, offsetBy: 1)
                    let hexColor = String(hex[start...])

                    if hexColor.count == 8 {
                        let scanner = Scanner(string: hexColor)
                        var hexNumber: UInt64 = 0

                        if scanner.scanHexInt64(&hexNumber) {
                            r = CGFloat((hexNumber & 0xff000000) >> 24) / 255
                            g = CGFloat((hexNumber & 0x00ff0000) >> 16) / 255
                            b = CGFloat((hexNumber & 0x0000ff00) >> 8) / 255
                            a = CGFloat(hexNumber & 0x000000ff) / 255

                            self.init(red: r, green: g, blue: b, alpha: a)
                            return
                        }
                    }
                }

                return nil
            }
        }
        """
        static let uiColorExtension = "extension UIColor { \n"
        static let endCurlyBracket = "}"
    }
}
struct Tokens {
    static let color = "colors"
    static let font = "fonts"
    static let shape = "shapes"
}
struct FolderNames {
    static let color = "UIColors"
    static let font = "UIFonts"
    static let shapes = "UIShapes"
}
struct FileName {
    static let color = "UIColor+GlobalTokens.swift"
    static let font = "UIFont+GlobalTokens.swift"
    static let shapes = "UIShapes+GlobalTokens.swift"
}
