-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTweak.xm
More file actions
71 lines (55 loc) · 1.34 KB
/
Tweak.xm
File metadata and controls
71 lines (55 loc) · 1.34 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include "Tweak.h"
%group Colorizd
%hook SBIconImageView
- (id)contentsImage {
if (%orig){
iconImage = %orig;
}
return %orig;
}
%end
//Hook for the SpringBoard Icons
%hook SBIconLabelImageParameters
- (id)font {
return [UIFont fontWithName:@"HelveticaNeue" size:14.0];
}
- (BOOL)isColorspaceGrayscale {
return NO;
}
- (id)textColor {
Helper *help = [[Helper alloc]init];
if (iconImage){
return [help averageColorWithImage:iconImage];
}
return [help randomColor];
}
%end
//Multitask Hook
%hook SBFluidSwitcherItemContainerHeaderItem
-(id)titleTextColor{
if (self.image){
Helper *help = [[Helper alloc]init];
return [help averageColorWithImage:self.image];
}
return %orig;
}
%end
%hook SBIconLegibilityLabelView
-(void)setImageParameters:(id)arg1{
Helper *help = [[Helper alloc]init];
self.layer.cornerRadius = 5;
self.layer.masksToBounds = true;
if (iconImage){
self.backgroundColor = [help secondaryAverageColorWithImage:iconImage];
}else {
self.backgroundColor = [help randomColor];
}
return %orig;
}
%end
%end // Colorizd Group
%ctor {
preferences = [[HBPreferences alloc] initWithIdentifier:@"im.hearse.colorizdprefs"];
[preferences registerBool:&enabled default:YES forKey:@"enabled"];
if ([preferences boolForKey:@"enabled"]) %init(Colorizd);
}