//
//  UIColor+App.swift
//  sdk-demo-ios
//
//  Created by Smaato Inc on 05.07.18.
//  Copyright © 2018 Smaato Inc. All rights reserved.
//

import UIKit

extension UIColor {

    convenience init(hex: Int, alpha: Double) {
        assert(hex >= 0x000000 && hex <= 0xFFFFFF, "Hex value is out of range: [0x000000, 0xFFFFFF]")
        assert(alpha >= 0.0 && alpha <= 1.0, "Alpha value is out of range: [0.0, 1.0]")

        let r = (hex >> 16) & 0xFF
        let g = (hex >> 8) & 0xFF
        let b = (hex) & 0xFF

        self.init(red: CGFloat(r) / 255.0, green: CGFloat(g) / 255.0, blue: CGFloat(b) / 255.0, alpha: CGFloat(alpha))
    }

    static let appColor = UIColor(red: 75 / 255.0, green: 187 / 255.0, blue: 235 / 255.0, alpha: 1.0)

    static let appGrayText = UIColor(hex: 0xA4A4A4, alpha: 1.0)

}
