[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6995":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":14,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":30,"discoverSource":31},6995,"UIImageColors","jathu\u002FUIImageColors","jathu","Fetches the most dominant and prominent colors from an image.","",null,"Swift",3274,248,1,0,2,59.89,"MIT License",true,false,"master",[23,24,25,26],"ios","itunes","uicolor","uiimage","2026-06-12 04:00:31","![Swift](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSwift-5.0-orange.svg)\n![platform: iOS, tvOS and macOS](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-iOS%20%7C%20tvOS%20%7C%20macOS-lightgrey.svg)\n\n# UIImageColors\n\niTunes style color fetcher for `UIImage` and `NSImage`. It fetches the most dominant and prominent colors.\n\n![preview](preview.png)\n\n## Installation\n\n### Manual\n\nCopy [UIImageColors.swift](UIImageColors\u002FSources\u002FUIImageColors.swift) into your project.\n\n### [Cocoapods](https:\u002F\u002Fcocoapods.org)\n\nAdd UIImageColors to your [`Podfile`](https:\u002F\u002Fcocoapods.org\u002Fpods\u002FUIImageColors):\n\n```\npod 'UIImageColors'\n```\n\n### [Carthage](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage)\n\nAdd UIImageColors to your `Cartfile`:\n\n```\ngithub \"jathu\u002FUIImageColors\"\n```\n\n## Example\n\nAsynchronous example:\n\n```swift\nlet image = UIImage(named: \"yeezus.png\")\n\nimage.getColors { colors in\n  backgroundView.backgroundColor = colors.background\n  mainLabel.textColor = colors.primary\n  secondaryLabel.textColor = colors.secondary\n  detailLabel.textColor = colors.detail\n}\n```\n\nSynchronous example:\n\n```swift\nlet colors = UIImage(named: \"yeezus.png\").getColors()\n\nbackgroundView.backgroundColor = colors.background\nmainLabel.textColor = colors.primary\nsecondaryLabel.textColor = colors.secondary\ndetailLabel.textColor = colors.detail\n```\n\n## Image Methods\n\n```swift\ngetColors() -> UIImageColors?\ngetColors(quality: ImageColorsQuality) -> UIImageColors?\ngetColors(_ completion: (UIImageColors?) -> Void) -> Void\ngetColors(quality: UIImageColorsQuality, _ completion: (UIImageColors?) -> Void) -> Void\n```\n\n## UIImageColors Objects\n\n`UIImageColors` is struct that contains four different `UIColor` (or `NSColor` on macOS) variables.\n\n```swift\npublic struct UIImageColors {\n    public var background: UIColor!\n    public var primary: UIColor!\n    public var secondary: UIColor!\n    public var detail: UIColor!\n}\n```\n\n`UIImageColorsQuality` is a enum with four different qualities. The qualities refer to how much the original image is scaled down. `Lowest` implies smaller size and faster performance at the cost of quality colors. `High` implies larger size with slower performance with good colors. `Highest` implies no downscaling and very good colors, but it is very slow.\n\nThe default is set to `high`.\n\n```swift\npublic enum UIImageColorsQuality: CGFloat {\n    case lowest = 50 \u002F\u002F 50px\n    case low = 100 \u002F\u002F 100px\n    case high = 250 \u002F\u002F 250px\n    case highest = 0 \u002F\u002F No scale\n}\n```\n\n## License\n\nThe [license](https:\u002F\u002Fgithub.com\u002Fjathu\u002FUIImageColors\u002Fblob\u002Fmaster\u002FLICENSE) is provided in the project folder. This is based on Panic's [OS X ColorArt](https:\u002F\u002Fgithub.com\u002Fpanicinc\u002FColorArt\u002F#license).\n\n------\nJune 2015 - Toronto\n","UIImageColors 是一个用于从图片中提取主要和显著颜色的库。它支持iOS、tvOS和macOS平台，使用Swift语言编写。该库能够异步或同步地从`UIImage`或`NSImage`中获取背景色、主色、次色以及细节色，并允许用户根据需要调整处理质量以平衡性能与颜色准确性。适用于需要自动为UI元素着色以匹配特定图片的应用场景，如自定义主题、动态壁纸等。","2026-06-11 03:10:02","top_language"]