-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNPColorMacro.h
More file actions
51 lines (41 loc) · 1.89 KB
/
NPColorMacro.h
File metadata and controls
51 lines (41 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// NPColorMacro.h
// NPColorMacro
//
// Created by NickPan on 2019/11/24.
// Copyright © 2019 NickPan. All rights reserved.
//
#ifndef NPColorMacro_h
#define NPColorMacro_h
/** Storage relation color macro */
#ifdef __OBJC__
/** RGB */
#define RGBA(r, g, b, a) ([UIColor colorWithRed:((r) / 255.f) \
green:((g) / 255.f) \
blue:((b) / 255.f) \
alpha:a])
#define RGB(r, g, b) (RGBA(r, g, b, 1.f))
/** Hex */
#define HexA(value, a) [UIColor colorWithRed:((float)(((value) & 0xFF0000) >> 16))/255.f \
green:((float)(((value) & 0x00FF00) >> 8))/255.f \
blue:((float)(value & 0x0000FF))/255.f \
alpha:a]
#define Hex(value) HexA(value, 1.f)
/** System Color */
#define kBlackColor [UIColor blackColor]
#define kDarkGrayColor [UIColor darkGrayColor]
#define kLightGrayColor [UIColor lightGrayColor]
#define kWhiteColor [UIColor whiteColor]
#define kGrayColor [UIColor grayColor]
#define kRedColor [UIColor redColor]
#define kGreenColor [UIColor greenColor]
#define kBlueColor [UIColor blueColor]
#define kCyanColor [UIColor cyanColor]
#define kYellowColor [UIColor yellowColor]
#define kMagentaColor [UIColor magentaColor]
#define kOrangeColor [UIColor orangeColor]
#define kPurpleColor [UIColor purpleColor]
#define kClearColor [UIColor clearColor]
#define kGroupTableViewBackgroundColor [UIColor groupTableViewBackgroundColor]
#endif
#endif /* NPColorMacro_h */