├── ColorfulLines.h ├── ColorfulLines.plist ├── ColorfulLinesPreferences ├── CFLRootListController.h ├── CFLRootListController.m ├── CFLSwitchCell.h ├── CFLSwitchCell.m ├── Makefile ├── Resources │ ├── Info.plist │ ├── Root.plist │ ├── discord.png │ ├── discord@2x.png │ ├── discord@3x.png │ ├── github.png │ ├── github@2x.png │ ├── github@3x.png │ ├── icon.png │ ├── icon@2x.png │ └── icon@3x.png └── entry.plist ├── Makefile ├── README.md ├── Swift └── Extensions │ └── UIImageColor.swift ├── Tweak.x └── control /ColorfulLines.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "ColorfulLines-Swift.h" 3 | 4 | //--Preferences Variables--// 5 | BOOL enabled; 6 | 7 | BOOL scrollColorEnabled; 8 | BOOL scrollColorFromIcon; 9 | UIColor *scrollColor; 10 | BOOL scrollHidden; 11 | 12 | BOOL caretColorEnabled; 13 | BOOL cursorColorFromIcon; 14 | UIColor *caretColor; 15 | BOOL caretHidden; 16 | 17 | BOOL floatingCaretColorEnabled; 18 | BOOL floatingCursorColorFromIcon; 19 | UIColor *floatingCaretColor; 20 | 21 | BOOL selectionBarColorEnabled; 22 | BOOL selectionBarColorFromIcon; 23 | UIColor *selectionBarColor; 24 | 25 | BOOL highlightColorEnabled; 26 | BOOL highlightColorFromIcon; 27 | UIColor *highlightColor; 28 | 29 | //--Global Variables--// 30 | UIColor *iconColor; 31 | 32 | //--Interface Declarations--// 33 | @interface UIImage (ColorfulLines) 34 | + (UIImage *)_applicationIconImageForBundleIdentifier:(id)arg1 format:(int)arg2 scale:(int)arg3; 35 | @end 36 | 37 | @interface _UIScrollViewScrollIndicator: UIView 38 | @end 39 | 40 | @interface UITextSelectionView 41 | @end 42 | 43 | @interface UITextInputTraits 44 | @end -------------------------------------------------------------------------------- /ColorfulLines.plist: -------------------------------------------------------------------------------- 1 | { Filter = { Bundles = ( "com.apple.UIKit" ); }; } -------------------------------------------------------------------------------- /ColorfulLinesPreferences/CFLRootListController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface PSListController (ColorfulLines) 5 | - (BOOL)containsSpecifier:(id)arg1; 6 | @end 7 | 8 | @interface CFLRootListController: PSListController 9 | @property (nonatomic, retain) NSMutableDictionary *savedSpecifiers; 10 | @property (nonatomic) BOOL enabledSwitchStateWhenLastReset; 11 | @end -------------------------------------------------------------------------------- /ColorfulLinesPreferences/CFLRootListController.m: -------------------------------------------------------------------------------- 1 | #include "CFLRootListController.h" 2 | 3 | @implementation CFLRootListController 4 | 5 | - (NSArray *)specifiers { 6 | 7 | if (!_specifiers) { 8 | _specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self]; 9 | } 10 | 11 | NSArray *chosenIDs = @[@"101", @"201", @"301", @"401", @"501"]; 12 | [self setSavedSpecifiers:(![self savedSpecifiers]) ? [[NSMutableDictionary alloc] init] : [self savedSpecifiers]]; 13 | for (PSSpecifier *specifier in _specifiers) { 14 | if ([chosenIDs containsObject:[specifier propertyForKey:@"id"]]) { 15 | [[self savedSpecifiers] setObject:specifier forKey:[specifier propertyForKey:@"id"]]; 16 | } 17 | } 18 | 19 | return _specifiers; 20 | 21 | } 22 | 23 | - (id)readPreferenceValue:(PSSpecifier*)specifier { 24 | 25 | NSString *path = [NSString stringWithFormat:@"/User/Library/Preferences/%@.plist", specifier.properties[@"defaults"]]; 26 | NSMutableDictionary *settings = [NSMutableDictionary dictionary]; 27 | [settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile:path]]; 28 | return (settings[specifier.properties[@"key"]]) ?: specifier.properties[@"default"]; 29 | 30 | } 31 | 32 | - (void)setPreferenceValue:(id)value specifier:(PSSpecifier*)specifier { 33 | 34 | NSString *path = [NSString stringWithFormat:@"/User/Library/Preferences/%@.plist", specifier.properties[@"defaults"]]; 35 | NSMutableDictionary *settings = [NSMutableDictionary dictionary]; 36 | [settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile:path]]; 37 | [settings setObject:value forKey:specifier.properties[@"key"]]; 38 | [settings writeToFile:path atomically:YES]; 39 | CFStringRef notificationName = (__bridge CFStringRef)specifier.properties[@"PostNotification"]; 40 | if (notificationName) { 41 | CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), notificationName, NULL, NULL, YES); 42 | } 43 | 44 | NSString *key = [specifier propertyForKey:@"key"]; 45 | if ([key isEqualToString:@"scrollColorFromIcon"]) { 46 | if (![value boolValue]) { 47 | [self insertContiguousSpecifiers:@[[self savedSpecifiers][@"101"]] afterSpecifierID:@"100" animated:YES]; 48 | } else if ([self containsSpecifier:[self savedSpecifiers][@"101"]]) { 49 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"101"]] animated:YES]; 50 | } 51 | } 52 | if ([key isEqualToString:@"cursorColorFromIcon"]) { 53 | if (![value boolValue]) { 54 | [self insertContiguousSpecifiers:@[[self savedSpecifiers][@"201"]] afterSpecifierID:@"200" animated:YES]; 55 | } else if ([self containsSpecifier:[self savedSpecifiers][@"201"]]) { 56 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"201"]] animated:YES]; 57 | } 58 | } 59 | if ([key isEqualToString:@"floatingCursorColorFromIcon"]) { 60 | if (![value boolValue]) { 61 | [self insertContiguousSpecifiers:@[[self savedSpecifiers][@"301"]] afterSpecifierID:@"300" animated:YES]; 62 | } else if ([self containsSpecifier:[self savedSpecifiers][@"301"]]) { 63 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"301"]] animated:YES]; 64 | } 65 | } 66 | if ([key isEqualToString:@"selectionBarColorFromIcon"]) { 67 | if (![value boolValue]) { 68 | [self insertContiguousSpecifiers:@[[self savedSpecifiers][@"401"]] afterSpecifierID:@"400" animated:YES]; 69 | } else if ([self containsSpecifier:[self savedSpecifiers][@"401"]]) { 70 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"401"]] animated:YES]; 71 | } 72 | } 73 | if ([key isEqualToString:@"highlightColorFromIcon"]) { 74 | if (![value boolValue]) { 75 | [self insertContiguousSpecifiers:@[[self savedSpecifiers][@"501"]] afterSpecifierID:@"500" animated:YES]; 76 | } else if ([self containsSpecifier:[self savedSpecifiers][@"501"]]) { 77 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"501"]] animated:YES]; 78 | } 79 | } 80 | 81 | } 82 | 83 | - (void)reloadSpecifiers { 84 | 85 | [super reloadSpecifiers]; 86 | 87 | NSDictionary *preferences = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.yulkytulky.colorfullines.plist"]; 88 | if ([preferences[@"scrollColorFromIcon"] boolValue]) { 89 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"101"]] animated:NO]; 90 | } 91 | if ([preferences[@"cursorColorFromIcon"] boolValue]) { 92 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"201"]] animated:NO]; 93 | } 94 | if ([preferences[@"floatingCursorColorFromIcon"] boolValue]) { 95 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"301"]] animated:NO]; 96 | } 97 | if ([preferences[@"selectionBarColorFromIcon"] boolValue]) { 98 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"401"]] animated:NO]; 99 | } 100 | if ([preferences[@"highlightColorFromIcon"] boolValue]) { 101 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"501"]] animated:NO]; 102 | } 103 | 104 | } 105 | 106 | - (void)viewDidLoad { 107 | 108 | [super viewDidLoad]; 109 | 110 | NSDictionary *preferences = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.yulkytulky.colorfullines.plist"]; 111 | if ([preferences[@"scrollColorFromIcon"] boolValue]) { 112 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"101"]] animated:NO]; 113 | } 114 | if ([preferences[@"cursorColorFromIcon"] boolValue]) { 115 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"201"]] animated:NO]; 116 | } 117 | if ([preferences[@"floatingCursorColorFromIcon"] boolValue]) { 118 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"301"]] animated:NO]; 119 | } 120 | if ([preferences[@"selectionBarColorFromIcon"] boolValue]) { 121 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"401"]] animated:NO]; 122 | } 123 | if ([preferences[@"highlightColorFromIcon"] boolValue]) { 124 | [self removeContiguousSpecifiers:@[[self savedSpecifiers][@"501"]] animated:NO]; 125 | } 126 | 127 | } 128 | 129 | - (void)github { 130 | 131 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://github.com/YulkyTulky/ColorfulLines"] options:@{} completionHandler:nil]; 132 | 133 | } 134 | 135 | - (void)discord { 136 | 137 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://discord.gg/Z8hqzXY"] options:@{} completionHandler:nil]; 138 | 139 | } 140 | 141 | @end -------------------------------------------------------------------------------- /ColorfulLinesPreferences/CFLSwitchCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface CFLSwitchCell : PSSwitchTableCell 4 | @end -------------------------------------------------------------------------------- /ColorfulLinesPreferences/CFLSwitchCell.m: -------------------------------------------------------------------------------- 1 | #import "CFLSwitchCell.h" 2 | 3 | @implementation CFLSwitchCell 4 | 5 | - (void)setControl:(UISwitch *)control { 6 | 7 | [control setOnTintColor:[UIColor colorWithRed:1.00 green:0.53 blue:0.67 alpha:1.00]]; 8 | 9 | [super setControl:control]; 10 | 11 | } 12 | 13 | @end -------------------------------------------------------------------------------- /ColorfulLinesPreferences/Makefile: -------------------------------------------------------------------------------- 1 | ARCHS = arm64 arm64e 2 | 3 | include $(THEOS)/makefiles/common.mk 4 | 5 | BUNDLE_NAME = ColorfulLinesPreferences 6 | 7 | ColorfulLinesPreferences_FILES = CFLRootListController.m CFLSwitchCell.m 8 | ColorfulLinesPreferences_INSTALL_PATH = /Library/PreferenceBundles 9 | ColorfulLinesPreferences_FRAMEWORKS = UIKit 10 | ColorfulLinesPreferences_PRIVATE_FRAMEWORKS = Preferences 11 | ColorfulLinesPreferences_CFLAGS = -fobjc-arc 12 | 13 | include $(THEOS_MAKE_PATH)/bundle.mk 14 | 15 | internal-stage:: 16 | $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END) 17 | $(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/ColorfulLinesPreferences.plist$(ECHO_END) -------------------------------------------------------------------------------- /ColorfulLinesPreferences/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ColorfulLinesPreferences 9 | CFBundleIdentifier 10 | com.yulkytulky.colorfullines 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | NSPrincipalClass 22 | CFLRootListController 23 | 24 | 25 | -------------------------------------------------------------------------------- /ColorfulLinesPreferences/Resources/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | 9 | cell 10 | PSGroupCell 11 | label 12 | Enable Tweak 13 | 14 | 15 | cell 16 | PSSwitchCell 17 | cellClass 18 | CFLSwitchCell 19 | default 20 | 21 | defaults 22 | com.yulkytulky.colorfullines 23 | key 24 | enabled 25 | label 26 | Enabled 27 | icon 28 | icon.png 29 | PostNotification 30 | com.yulkytulky.colorfullines/saved 31 | 32 | 33 | 34 | cell 35 | PSGroupCell 36 | label 37 | Scrollbar 38 | 39 | 40 | cell 41 | PSSwitchCell 42 | cellClass 43 | CFLSwitchCell 44 | default 45 | 46 | defaults 47 | com.yulkytulky.colorfullines 48 | key 49 | scrollColorEnabled 50 | label 51 | Custom Scrollbar Color 52 | PostNotification 53 | com.yulkytulky.colorfullines/saved 54 | 55 | 56 | cell 57 | PSSwitchCell 58 | cellClass 59 | CFLSwitchCell 60 | default 61 | 62 | defaults 63 | com.yulkytulky.colorfullines 64 | key 65 | scrollColorFromIcon 66 | label 67 | Scrollbar Color From Icon 68 | id 69 | 100 70 | PostNotification 71 | com.yulkytulky.colorfullines/saved 72 | 73 | 74 | cell 75 | PSLinkCell 76 | cellClass 77 | SparkColourPickerCell 78 | libsparkcolourpicker 79 | 80 | defaults 81 | com.yulkytulky.colorfullines 82 | fallback 83 | #ffffff:0.5 84 | alpha 85 | 86 | 87 | key 88 | scrollColor 89 | label 90 | Scrollbar Color 91 | id 92 | 101 93 | PostNotification 94 | com.yulkytulky.colorfullines/saved 95 | 96 | 97 | cell 98 | PSSwitchCell 99 | cellClass 100 | CFLSwitchCell 101 | default 102 | 103 | defaults 104 | com.yulkytulky.colorfullines 105 | key 106 | scrollHidden 107 | label 108 | Hide Scrollbar 109 | PostNotification 110 | com.yulkytulky.colorfullines/saved 111 | 112 | 113 | 114 | cell 115 | PSGroupCell 116 | label 117 | Cursor 118 | 119 | 120 | cell 121 | PSSwitchCell 122 | cellClass 123 | CFLSwitchCell 124 | default 125 | 126 | defaults 127 | com.yulkytulky.colorfullines 128 | key 129 | caretColorEnabled 130 | label 131 | Custom Cursor Color 132 | PostNotification 133 | com.yulkytulky.colorfullines/saved 134 | 135 | 136 | cell 137 | PSSwitchCell 138 | cellClass 139 | CFLSwitchCell 140 | default 141 | 142 | defaults 143 | com.yulkytulky.colorfullines 144 | key 145 | cursorColorFromIcon 146 | label 147 | Cursor Color From Icon 148 | id 149 | 200 150 | PostNotification 151 | com.yulkytulky.colorfullines/saved 152 | 153 | 154 | cell 155 | PSLinkCell 156 | cellClass 157 | SparkColourPickerCell 158 | libsparkcolourpicker 159 | 160 | defaults 161 | com.yulkytulky.colorfullines 162 | fallback 163 | #0984ff:1.0 164 | alpha 165 | 166 | 167 | key 168 | caretColor 169 | label 170 | Cursor Color 171 | id 172 | 201 173 | PostNotification 174 | com.yulkytulky.colorfullines/saved 175 | 176 | 177 | cell 178 | PSSwitchCell 179 | cellClass 180 | CFLSwitchCell 181 | default 182 | 183 | defaults 184 | com.yulkytulky.colorfullines 185 | key 186 | caretHidden 187 | label 188 | Hide Cursor 189 | PostNotification 190 | com.yulkytulky.colorfullines/saved 191 | 192 | 193 | 194 | cell 195 | PSGroupCell 196 | label 197 | Floating Cursor 198 | 199 | 200 | cell 201 | PSSwitchCell 202 | cellClass 203 | CFLSwitchCell 204 | default 205 | 206 | defaults 207 | com.yulkytulky.colorfullines 208 | key 209 | floatingCaretColorEnabled 210 | label 211 | Custom Floating Cursor Color 212 | PostNotification 213 | com.yulkytulky.colorfullines/saved 214 | 215 | 216 | cell 217 | PSSwitchCell 218 | cellClass 219 | CFLSwitchCell 220 | default 221 | 222 | defaults 223 | com.yulkytulky.colorfullines 224 | key 225 | floatingCursorColorFromIcon 226 | label 227 | Floating Cursor Color From Icon 228 | id 229 | 300 230 | PostNotification 231 | com.yulkytulky.colorfullines/saved 232 | 233 | 234 | cell 235 | PSLinkCell 236 | cellClass 237 | SparkColourPickerCell 238 | libsparkcolourpicker 239 | 240 | defaults 241 | com.yulkytulky.colorfullines 242 | fallback 243 | #0984ff:1.0 244 | alpha 245 | 246 | 247 | key 248 | floatingCaretColor 249 | label 250 | Floating Cursor Color 251 | id 252 | 301 253 | PostNotification 254 | com.yulkytulky.colorfullines/saved 255 | 256 | 257 | 258 | cell 259 | PSGroupCell 260 | label 261 | Selection Bar 262 | 263 | 264 | cell 265 | PSSwitchCell 266 | cellClass 267 | CFLSwitchCell 268 | default 269 | 270 | defaults 271 | com.yulkytulky.colorfullines 272 | key 273 | selectionBarColorEnabled 274 | label 275 | Custom Selection Bar Color 276 | PostNotification 277 | com.yulkytulky.colorfullines/saved 278 | 279 | 280 | cell 281 | PSSwitchCell 282 | cellClass 283 | CFLSwitchCell 284 | default 285 | 286 | defaults 287 | com.yulkytulky.colorfullines 288 | key 289 | selectionBarColorFromIcon 290 | label 291 | Selection Bar Color From Icon 292 | id 293 | 400 294 | PostNotification 295 | com.yulkytulky.colorfullines/saved 296 | 297 | 298 | cell 299 | PSLinkCell 300 | cellClass 301 | SparkColourPickerCell 302 | libsparkcolourpicker 303 | 304 | defaults 305 | com.yulkytulky.colorfullines 306 | fallback 307 | #0984ff:1.0 308 | alpha 309 | 310 | 311 | key 312 | selectionBarColor 313 | label 314 | Selection Bar Color 315 | id 316 | 401 317 | PostNotification 318 | com.yulkytulky.colorfullines/saved 319 | 320 | 321 | 322 | cell 323 | PSGroupCell 324 | label 325 | Highlight 326 | 327 | 328 | cell 329 | PSSwitchCell 330 | cellClass 331 | CFLSwitchCell 332 | default 333 | 334 | defaults 335 | com.yulkytulky.colorfullines 336 | key 337 | highlightColorEnabled 338 | label 339 | Custom Highlight Color 340 | PostNotification 341 | com.yulkytulky.colorfullines/saved 342 | 343 | 344 | cell 345 | PSSwitchCell 346 | cellClass 347 | CFLSwitchCell 348 | default 349 | 350 | defaults 351 | com.yulkytulky.colorfullines 352 | key 353 | highlightColorFromIcon 354 | label 355 | Highlight Color From Icon 356 | id 357 | 500 358 | PostNotification 359 | com.yulkytulky.colorfullines/saved 360 | 361 | 362 | cell 363 | PSLinkCell 364 | cellClass 365 | SparkColourPickerCell 366 | libsparkcolourpicker 367 | 368 | defaults 369 | com.yulkytulky.colorfullines 370 | fallback 371 | #0984ff:0.1 372 | alpha 373 | 374 | 375 | key 376 | highlightColor 377 | label 378 | Highlight Color 379 | id 380 | 501 381 | PostNotification 382 | com.yulkytulky.colorfullines/saved 383 | 384 | 385 | 386 | cell 387 | PSGroupCell 388 | footerText 389 | Developed by YulkyTulky 390 | 391 | 392 | cell 393 | PSButtonCell 394 | action 395 | github 396 | icon 397 | github.png 398 | label 399 | Source Code ❤️ 400 | 401 | 402 | cell 403 | PSButtonCell 404 | action 405 | discord 406 | icon 407 | discord.png 408 | label 409 | Discord Server 410 | 411 | 412 | 413 | title 414 | Colorful Lines 415 | 416 | -------------------------------------------------------------------------------- /ColorfulLinesPreferences/Resources/discord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YulkyTulky/ColorfulLines/18629e247b1122f770ecabbad67b89d576b754e6/ColorfulLinesPreferences/Resources/discord.png -------------------------------------------------------------------------------- /ColorfulLinesPreferences/Resources/discord@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YulkyTulky/ColorfulLines/18629e247b1122f770ecabbad67b89d576b754e6/ColorfulLinesPreferences/Resources/discord@2x.png -------------------------------------------------------------------------------- /ColorfulLinesPreferences/Resources/discord@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YulkyTulky/ColorfulLines/18629e247b1122f770ecabbad67b89d576b754e6/ColorfulLinesPreferences/Resources/discord@3x.png -------------------------------------------------------------------------------- /ColorfulLinesPreferences/Resources/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YulkyTulky/ColorfulLines/18629e247b1122f770ecabbad67b89d576b754e6/ColorfulLinesPreferences/Resources/github.png -------------------------------------------------------------------------------- /ColorfulLinesPreferences/Resources/github@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YulkyTulky/ColorfulLines/18629e247b1122f770ecabbad67b89d576b754e6/ColorfulLinesPreferences/Resources/github@2x.png -------------------------------------------------------------------------------- /ColorfulLinesPreferences/Resources/github@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YulkyTulky/ColorfulLines/18629e247b1122f770ecabbad67b89d576b754e6/ColorfulLinesPreferences/Resources/github@3x.png -------------------------------------------------------------------------------- /ColorfulLinesPreferences/Resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YulkyTulky/ColorfulLines/18629e247b1122f770ecabbad67b89d576b754e6/ColorfulLinesPreferences/Resources/icon.png -------------------------------------------------------------------------------- /ColorfulLinesPreferences/Resources/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YulkyTulky/ColorfulLines/18629e247b1122f770ecabbad67b89d576b754e6/ColorfulLinesPreferences/Resources/icon@2x.png -------------------------------------------------------------------------------- /ColorfulLinesPreferences/Resources/icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YulkyTulky/ColorfulLines/18629e247b1122f770ecabbad67b89d576b754e6/ColorfulLinesPreferences/Resources/icon@3x.png -------------------------------------------------------------------------------- /ColorfulLinesPreferences/entry.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | entry 6 | 7 | bundle 8 | ColorfulLinesPreferences 9 | cell 10 | PSLinkCell 11 | detail 12 | CFLRootListController 13 | icon 14 | icon.png 15 | isController 16 | 17 | label 18 | Colorful Lines 19 | 20 | 21 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ARCHS = arm64 arm64e 2 | 3 | TARGET = iphone:clang:13.5::12.0 4 | 5 | INSTALL_TARGET_PROCESSES = backboardd 6 | 7 | include $(THEOS)/makefiles/common.mk 8 | 9 | TWEAK_NAME = ColorfulLines 10 | 11 | ColorfulLines_FILES = Tweak.x Swift/Extensions/UIImageColor.swift 12 | ColorfulLines_CFLAGS = -fobjc-arc 13 | ColorfulLines_LIBRARIES = sparkcolourpicker 14 | 15 | include $(THEOS_MAKE_PATH)/tweak.mk 16 | SUBPROJECTS += ColorfulLinesPreferences 17 | include $(THEOS_MAKE_PATH)/aggregate.mk -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Colorful Lines 2 | 3 | Customize the scrollbar and cursor! 4 | Colorful Lines provides coloring (including custom opacity) and hiding options for the iOS scrollbar and cursor. 5 | Also includes custom options for cursor selection bar and highlight! 6 | 7 | Now supports using app icon colors. 8 | 9 | Built for iOS 12 and 13. -------------------------------------------------------------------------------- /Swift/Extensions/UIImageColor.swift: -------------------------------------------------------------------------------- 1 | // https://www.hackingwithswift.com/example-code/media/how-to-read-the-average-color-of-a-uiimage-using-ciareaaverage 2 | 3 | import UIKit 4 | 5 | @objc extension UIImage { 6 | var averageColor: UIColor? { 7 | guard let inputImage = CIImage(image: self) else { return nil } 8 | let extentVector = CIVector(x: inputImage.extent.origin.x, y: inputImage.extent.origin.y, z: inputImage.extent.size.width, w: inputImage.extent.size.height) 9 | 10 | guard let filter = CIFilter(name: "CIAreaAverage", parameters: [kCIInputImageKey: inputImage, kCIInputExtentKey: extentVector]) else { return nil } 11 | guard let outputImage = filter.outputImage else { return nil } 12 | 13 | var bitmap = [UInt8](repeating: 0, count: 4) 14 | let context = CIContext(options: [.workingColorSpace: kCFNull!]) 15 | context.render(outputImage, toBitmap: &bitmap, rowBytes: 4, bounds: CGRect(x: 0, y: 0, width: 1, height: 1), format: .RGBA8, colorSpace: nil) 16 | 17 | return UIColor(red: CGFloat(bitmap[0]) / 255, green: CGFloat(bitmap[1]) / 255, blue: CGFloat(bitmap[2]) / 255, alpha: CGFloat(bitmap[3]) / 255) 18 | } 19 | } -------------------------------------------------------------------------------- /Tweak.x: -------------------------------------------------------------------------------- 1 | #import "ColorfulLines.h" 2 | 3 | %group iOS13 // Open iOS13 Group 4 | 5 | //--Handle Scrollbar--// 6 | %hook _UIScrollViewScrollIndicator 7 | 8 | - (void)didMoveToWindow { // Hide scrollbar (could not find a better method to override) 9 | 10 | %orig; 11 | 12 | if (scrollHidden && enabled) { 13 | [self setHidden:YES]; 14 | } 15 | 16 | } 17 | 18 | - (id)_colorForStyle:(long long)arg1 { // Set scrollbar color 19 | 20 | if (scrollColorEnabled && enabled) { 21 | return scrollColorFromIcon ? (iconColor ? [iconColor colorWithAlphaComponent:0.5] : %orig) : scrollColor; 22 | } else { 23 | return %orig; 24 | } 25 | 26 | } 27 | 28 | %end 29 | 30 | %end // Close iOS13 Group 31 | 32 | %group iOS12 // Open iOS12 Group 33 | 34 | //--Handle Scrollbar--// 35 | %hook UIScrollView 36 | 37 | - (void)didMoveToWindow { // Hide scrollbar (could not find a better method to override) 38 | 39 | %orig; 40 | 41 | if (scrollHidden && enabled) { 42 | [self setHidden:YES]; 43 | } 44 | 45 | } 46 | 47 | - (void)addSubview:(UIView *)view { // Set scrollbar color 48 | 49 | %orig; 50 | 51 | if (scrollColorEnabled && enabled) { 52 | if ([view isMemberOfClass:[UIImageView class]] && CGSizeEqualToSize(view.frame.size, CGSizeMake(2.5, 2.5))) { // CODE USED FROM https://github.com/shepgoba/ColorScroll/blob/master/Tweak.xm 53 | UIImageView *imgView = (UIImageView *)view; 54 | [imgView setBackgroundColor:scrollColorFromIcon ? (iconColor ? [iconColor colorWithAlphaComponent:0.5] : [UIColor colorWithRed:1.00 green:1.00 blue:1.00 alpha:0.5]) : scrollColor]; 55 | [[imgView layer] setCornerRadius:1.5]; 56 | [imgView setImage:nil]; 57 | } 58 | } 59 | 60 | } 61 | 62 | %end 63 | 64 | %end // Close iOS12 Group 65 | 66 | // *********************************************** // 67 | // ALL BELOW IS COMPATIBLE WITH BOTH iOS 12 AND 13 // 68 | 69 | //--Handle Cursor--// 70 | %hook UITextSelectionView 71 | 72 | - (BOOL)visible { // Hide cursor 73 | 74 | if (caretHidden && enabled) { 75 | return NO; // Note that this will also hide the selection bar and highlight 76 | } else { 77 | return %orig; 78 | } 79 | 80 | } 81 | 82 | - (id)caretViewColor { // Set cursor color 83 | 84 | if (caretColorEnabled && enabled) { 85 | return cursorColorFromIcon ? (iconColor ? iconColor : %orig) : caretColor; 86 | } else { 87 | return %orig; 88 | } 89 | 90 | } 91 | 92 | - (id)floatingCaretViewColor { // Set floating cursor color 93 | 94 | if (floatingCaretColorEnabled && enabled) { 95 | return floatingCursorColorFromIcon ? (iconColor ? iconColor : %orig) : floatingCaretColor; 96 | } else { 97 | return %orig; // Note that %orig here will return custom cursor color if enabled 98 | } 99 | 100 | } 101 | 102 | %end 103 | 104 | //--Handle Selection Bar and Highlight--// 105 | %hook UITextInputTraits 106 | 107 | - (UIColor *)selectionBarColor { // Set selection bar color 108 | 109 | if (selectionBarColorEnabled && enabled) { 110 | return selectionBarColorFromIcon ? (iconColor ? iconColor : %orig) : selectionBarColor; 111 | } else { 112 | return %orig; 113 | } 114 | 115 | } 116 | 117 | - (UIColor *)selectionHighlightColor { // Set highlight color 118 | 119 | if (highlightColorEnabled && enabled) { 120 | return highlightColorFromIcon ? [iconColor colorWithAlphaComponent:0.1] : highlightColor; 121 | } else { 122 | return %orig; 123 | } 124 | 125 | } 126 | 127 | %end 128 | 129 | static void loadPrefs() { 130 | 131 | NSMutableDictionary *preferences = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/var/mobile/Library/Preferences/com.yulkytulky.colorfullines.plist"]; 132 | 133 | enabled = [preferences objectForKey:@"enabled"] ? [[preferences objectForKey:@"enabled"] boolValue] : YES; 134 | 135 | scrollColorEnabled = [preferences objectForKey:@"scrollColorEnabled"] ? [[preferences objectForKey:@"scrollColorEnabled"] boolValue] : YES; 136 | scrollColorFromIcon = [preferences objectForKey:@"scrollColorFromIcon"] ? [[preferences objectForKey:@"scrollColorFromIcon"] boolValue] : NO; 137 | scrollColor = [SparkColourPickerUtils colourWithString: [preferences objectForKey:@"scrollColor"] withFallback: @"#ffffff:0.5"]; 138 | scrollHidden = [preferences objectForKey:@"scrollHidden"] ? [[preferences objectForKey:@"scrollHidden"] boolValue] : NO; 139 | 140 | caretColorEnabled = [preferences objectForKey:@"caretColorEnabled"] ? [[preferences objectForKey:@"caretColorEnabled"] boolValue] : YES; 141 | cursorColorFromIcon = [preferences objectForKey:@"cursorColorFromIcon"] ? [[preferences objectForKey:@"cursorColorFromIcon"] boolValue] : NO; 142 | caretColor = [SparkColourPickerUtils colourWithString: [preferences objectForKey:@"caretColor"] withFallback: @"#0984ff:1.0"]; 143 | caretHidden = [preferences objectForKey:@"caretHidden"] ? [[preferences objectForKey:@"caretHidden"] boolValue] : NO; 144 | 145 | floatingCaretColorEnabled = [preferences objectForKey:@"floatingCaretColorEnabled"] ? [[preferences objectForKey:@"floatingCaretColorEnabled"] boolValue] : YES; 146 | floatingCursorColorFromIcon = [preferences objectForKey:@"floatingCursorColorFromIcon"] ? [[preferences objectForKey:@"floatingCursorColorFromIcon"] boolValue] : NO; 147 | floatingCaretColor = [SparkColourPickerUtils colourWithString: [preferences objectForKey:@"floatingCaretColor"] withFallback: @"#0984ff:1.0"]; 148 | 149 | selectionBarColorEnabled = [preferences objectForKey:@"selectionBarColorEnabled"] ? [[preferences objectForKey:@"selectionBarColorEnabled"] boolValue] : YES; 150 | selectionBarColorFromIcon = [preferences objectForKey:@"selectionBarColorFromIcon"] ? [[preferences objectForKey:@"selectionBarColorFromIcon"] boolValue] : NO; 151 | selectionBarColor = [SparkColourPickerUtils colourWithString: [preferences objectForKey:@"selectionBarColor"] withFallback: @"#0984ff:1.0"]; 152 | 153 | highlightColorEnabled = [preferences objectForKey:@"highlightColorEnabled"] ? [[preferences objectForKey:@"highlightColorEnabled"] boolValue] : YES; 154 | highlightColorFromIcon = [preferences objectForKey:@"highlightColorFromIcon"] ? [[preferences objectForKey:@"highlightColorFromIcon"] boolValue] : NO; 155 | highlightColor = [SparkColourPickerUtils colourWithString: [preferences objectForKey:@"highlightColor"] withFallback: @"#0984ff:0.1"]; 156 | 157 | } 158 | 159 | static void loadAverageColor() { 160 | 161 | NSString *bundleID = [[NSBundle mainBundle] bundleIdentifier]; 162 | if (!([bundleID isEqualToString:@"com.apple.springboard"] || [bundleID isEqualToString:@"com.apple.Spotlight"])) { 163 | UIImage *icon = [UIImage _applicationIconImageForBundleIdentifier:bundleID format:2 scale:2]; 164 | iconColor = [icon averageColor]; 165 | } 166 | 167 | } 168 | 169 | %ctor { 170 | 171 | loadPrefs(); // Load preferences into variables 172 | CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)loadPrefs, CFSTR("com.yulkytulky.colorfullines/saved"), NULL, CFNotificationSuspensionBehaviorCoalesce); // Listen for preference changes 173 | loadAverageColor(); 174 | 175 | %init; 176 | 177 | // fixed bug here in version 1.2 & 1.2.1 178 | if (@available(iOS 13.0, *)) { 179 | %init(iOS13); 180 | } else { 181 | %init(iOS12); 182 | } 183 | 184 | } 185 | // If you're reading this, I hope you had a jolly time reading my code! Have a wonderful day! -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Package: com.yulkytulky.colorfullines 2 | Name: Colorful Lines 3 | Depends: mobilesubstrate, preferenceloader, com.spark.libsparkcolourpicker 4 | Version: 1.3 5 | Architecture: iphoneos-arm 6 | Description: Customize the scrollbar, cursor, selection bars, and highlight! 7 | Maintainer: YulkyTulky 8 | Author: YulkyTulky 9 | Section: Tweaks 10 | --------------------------------------------------------------------------------