Welcome to mirror list, hosted at ThFree Co, Russian Federation.

UIColor+MapsMeColor.mm « Maps « iphone - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ced29f18a94e11181f67f950b16a336b627e2eed (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#import "UIColor+MapsMeColor.h"

static CGFloat const alpha12 = 0.12;
static CGFloat const alpha26 = 0.26;
static CGFloat const alpha40 = 0.40;
static CGFloat const alpha54 = 0.54;
static CGFloat const alpha80 = 0.80;
static CGFloat const alpha87 = 0.87;
static CGFloat const alpha100 = 1.;

@implementation UIColor (MapsMeColor)

// Dark green color
+ (UIColor *)primaryDark
{
  return [UIColor colorWithRed:scaled(24.) green:scaled(128) blue:scaled(68.) alpha:alpha100];
}

// Green color
+ (UIColor *)primary
{
  return [UIColor colorWithRed:scaled(32.) green:scaled(152.) blue:scaled(82.) alpha:alpha100];
}

// Light green color
+ (UIColor *)primaryLight
{
  return [UIColor colorWithRed:scaled(36.) green:scaled(180.) blue:scaled(98.) alpha:alpha100];
}

// Use for opaque fullscreen
+ (UIColor *)fadeBackground
{
  return [[UIColor blackColor] colorWithAlphaComponent:alpha80];
}

// Background color && press color
+ (UIColor *)pressBackground
{
  return [UIColor colorWithRed:scaled(245.) green:scaled(245.) blue:scaled(245.) alpha:alpha100];
}
// Red color (use for status closed in place page)
+ (UIColor *)red
{
  return [UIColor colorWithRed:scaled(230.) green:scaled(15.) blue:scaled(35.) alpha:alpha100];
}
// Orange color (use for status 15 min in place page)
+ (UIColor *)orange
{
  return [UIColor colorWithRed:1. green:scaled(120.) blue:scaled(5.) alpha:alpha100];
}

// Blue color (use for links and phone numbers)
+ (UIColor *)linkBlue
{
  return [UIColor colorWithRed:scaled(30.) green:scaled(150.) blue:scaled(240.) alpha:alpha100];
}

+ (UIColor *)linkBlueDark
{
  return [UIColor colorWithRed:scaled(25.) green:scaled(135.) blue:scaled(215.) alpha:alpha100];
}

+ (UIColor *)blackPrimaryText
{
  return [[UIColor blackColor] colorWithAlphaComponent:alpha87];
}

+ (UIColor *)blackSecondaryText
{
  return [[UIColor blackColor] colorWithAlphaComponent:alpha54];
}

+ (UIColor *)blackStatusBarBackground
{
  return [[UIColor blackColor] colorWithAlphaComponent:alpha40];
}

+ (UIColor *)blackHintText
{
  return [[UIColor blackColor] colorWithAlphaComponent:alpha26];
}

+ (UIColor *)blackDividers
{
  return [[UIColor blackColor] colorWithAlphaComponent:alpha12];
}

+ (UIColor *)whitePrimaryText
{
  return [[UIColor whiteColor] colorWithAlphaComponent:alpha87];
}

+ (UIColor *)whiteSecondaryText
{
  return [[UIColor whiteColor] colorWithAlphaComponent:alpha54];
}

+ (UIColor *)whiteHintText
{
  return [[UIColor whiteColor] colorWithAlphaComponent:alpha26];
}

+ (UIColor *)whiteDividers
{
  return [[UIColor whiteColor] colorWithAlphaComponent:alpha12];
}

+ (UIColor *)buttonEnabledBlueText
{
  return [UIColor colorWithRed:scaled(3.) green:scaled(122.) blue:scaled(255.) alpha:alpha100];
}

+ (UIColor *)buttonDisabledBlueText
{
  return [self.buttonEnabledBlueText colorWithAlphaComponent:alpha26];
}

+ (UIColor *)buttonHighlightedBlueText
{
  return [UIColor colorWithRed:scaled(3.) green:scaled(122.) blue:scaled(255.) alpha:alpha54];
}

+ (UIColor *)alertBackground
{
  return [UIColor colorWithWhite:1. alpha:.88f];
}

+ (UIColor *)colorWithName:(NSString *)colorName
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
  return [[UIColor class] performSelector:NSSelectorFromString(colorName)];
#pragma clang diagnostic pop
}

CGFloat scaled(CGFloat f)
{
  return f / 255.;
}

@end