GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — MusicPlayerColor/Tweak.x at main · NightwindDev/MusicPlayerColor Expand file tree/ Copy pathTweak.xMore file actions 55 lines (42 loc) · 1.38 KB / Copy pathTweak.xFile metadata and controls55 lines (42 loc) · 1.38 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 /** * Copyright (c) 2024 Nightwind */ #import <UIKit/UIKit.h> #import <GcUniversal/GcColorPickerUtils.h> #import <rootless.h> #import "Notifications.h" static UIColor *prefs_musicPlayerColor = nil; static UIColor *const UIColorFromHex(NSString *const hexString) { if (!hexString) return nil; unsigned rgbValue = 0; NSScanner *const scanner = [NSScanner scannerWithString:hexString]; if ([hexString hasPrefix:@"#"]) { scanner.scanLocation = 1; } [scanner scanHexInt:&rgbValue]; return [UIColor colorWithRed:((rgbValue >> 24) & 0xFF) / 255.0 green:((rgbValue >> 16) & 0xFF) / 255.0 blue:((rgbValue >> 8) & 0xFF) / 255.0 alpha:(rgbValue & 0xFF) / 255.0 ]; } static void updatePrefs(void) { NSDictionary *const prefs = [NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.nightwind.musicplayercolorsettings.plist"]; if (prefs) { prefs_musicPlayerColor = UIColorFromHex([prefs objectForKey:@"MusicPlayerColor"]); } } @interface MRUNowPlayingView : UIView @end %hook MRUNowPlayingView - (void)didMoveToWindow { %orig; updatePrefs(); self.backgroundColor = prefs_musicPlayerColor; [[NSDistributedNotificationCenter defaultCenter] addObserverForName:kMusicPlayerColorChangedNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) { updatePrefs(); self.backgroundColor = prefs_musicPlayerColor; }]; } %end |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |