兵马未动,粮草先行。直接上代码,个人在学习,也希望对你有用。
//
// Color.swift
// BTC
//
// Created by 智创 on 2019/3/13.
// Copyright © 2019年 智创. All rights reserved.
//
import UIKit
//RGBA 设置颜色
public func RGB(R:CGFloat,G:CGFloat,B:CGFloat) ->UIColor {
return RGBA(R: R, G: G, B: B, A: 1.0)
}
public func RGBA(R:CGFloat,G:CGFloat,B:CGFloat,A:CGFloat) ->UIColor {
return UIColor.init(red: R/255.0, green: G/255.0, blue: B/255.0, alpha: A)
}
///16进制色号 设置颜色 示例:UIColorHex(0x26A7E8)
public func Color_Hex(value:UInt32) -> UIColor{
return Color_Hex_A(value: value, alpha: 1.0)
}
public func Color_Hex_A(value:UInt32, alpha:CGFloat) -> UIColor{
let color = UIColor.init(red: (((CGFloat)((value & 0xFF0000) >> 16)) / 255.0), green: (((CGFloat)((value & 0xFF0000) >> 16)) / 255.0), blue: (((CGFloat)((value & 0xFF0000) >> 16)) / 255.0), alpha: alpha)
return color
}
//主色调
public let main_color = Color_Hex(value: 0xe33f2d)
//背景色 接近白色
public let background_color = Color_Hex(value: 0xf9f9f9)
//灰色线条
public let LineGray_color = Color_Hex(value: 0xcacaca)
//导航栏字体颜色
public let navText_color = UIColor.white
swift UITabBarController -------(项目准备-学习1)
swift 适配问题 -------(项目准备-学习2)
网友评论