//
//  _UIColor.swift
//  Appt
//
//  Created by Jan Jaap de Groot on 26/05/2020.
//  Copyright © 2020 Stichting Appt All rights reserved.
//

import UIKit

extension UIColor {
    convenience init(red: Int, green: Int, blue: Int) {
        assert(red >= 0 && red <= 255, "Invalid red component")
        assert(green >= 0 && green <= 255, "Invalid green component")
        assert(blue >= 0 && blue <= 255, "Invalid blue component")
        self.init(red: CGFloat(red) / 255.0, green: CGFloat(green) / 255.0, blue: CGFloat(blue) / 255.0, alpha: 1.0)
    }
    
    convenience init(hex: Int) {
        self.init(red:(hex >> 16) & 0xff, green:(hex >> 8) & 0xff, blue:hex & 0xff)
    }

    static let primary = UIColor(named: "Primary")!
    static let background = UIColor(named: "Background")!
    static let foreground = UIColor(named: "Foreground")!
    static let disabled = UIColor(named: "Disabled")!
    static let textFieldDisabled = UIColor(named: "TextFieldDisabled")!
    static let categoryCellBackground = UIColor(named: "CategoryCellBackground")!
}
