[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6955":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":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":32,"discoverSource":33},6955,"Hue","zenangst\u002FHue","zenangst",":art: Hue is the all-in-one coloring utility that you'll ever need.","https:\u002F\u002Fgithub.com\u002Fzenangst",null,"Swift",3562,223,46,2,0,1,8,60.35,"Other",false,"master",true,[25,26,27,28],"color","gradient","hex","hue","2026-06-12 04:00:31","![Hue](https:\u002F\u002Fgithub.com\u002Fhyperoslo\u002FHue\u002Fblob\u002Fmaster\u002FImages\u002Fcover.png)\n\nHue is the all-in-one coloring utility that you'll ever need.\n\n[![Version](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fv\u002FHue.svg?style=flat)](http:\u002F\u002Fcocoadocs.org\u002Fdocsets\u002FHue)\n[![Carthage Compatible](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCarthage-compatible-4BC51D.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fl\u002FHue.svg?style=flat)](http:\u002F\u002Fcocoadocs.org\u002Fdocsets\u002FHue)\n[![Platform](https:\u002F\u002Fimg.shields.io\u002Fcocoapods\u002Fp\u002FHue.svg?style=flat)](http:\u002F\u002Fcocoadocs.org\u002Fdocsets\u002FHue)\n![Swift](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%20in-swift%205.0-orange.svg)\n\n## Usage\n\n#### Hex\n\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fhyperoslo\u002FHue\u002Fmaster\u002FImages\u002Ficon_v3.png\" alt=\"Hue Icon\" align=\"right\" \u002F>You can easily use hex colors with the `init(hex:)` convenience initializer on `UIColor`. It supports the following hex formats `#ffffff`, `ffffff`, `#fff`, `fff`\n```swift\nlet white = UIColor(hex: \"#ffffff\")\nlet black = UIColor(hex: \"#000000\")\nlet red = UIColor(hex: \"#ff0000\")\nlet blue = UIColor(hex: \"#0000ff\")\nlet green = UIColor(hex: \"#00ff00\")\nlet yellow = UIColor(hex: \"#ffff00\")\n```\n\n#### Computed color properties\n```swift\nlet white = UIColor(hex: \"#ffffff\")\nlet black = UIColor(hex: \"#000000\")\n\nif white.isDarkColor {} \u002F\u002F return false\nif white.isBlackOrWhite {} \u002F\u002F return true\n```\n\n#### Alpha\n`.alpha` is a sugar for `colorWithAlphaComponent`, internally it does the exact same thing, think of it as a\nlipstick for your implementation.\n```swift\nlet colorWithAlpha = myColor.alpha(0.75)\n```\n\n#### Gradients\nYou can easily create gradient layers using the `gradient()` method on arrays with `UIColor`.\nAs an extra bonus, you can also add a transform closure if you want to modify the `CAGradientLayer`.\n\n```swift\nlet gradient = [UIColor.blackColor(), UIColor.orangeColor()].gradient()\n\nlet secondGradient = [UIColor.blackColor(), UIColor.orangeColor()].gradient { gradient in\n  gradient.locations = [0.25, 1.0]\n  return gradient\n}\n```\n\n#### Image colors\n```swift\nlet image = UIImage(named: \"My Image\")\nlet (background, primary, secondary, detail) = image.colors()\n```\n\n#### Components\nYou can get red, green, blue, and alpha components from any UIColor by using the (red|green|blue|alpha)Component property.\n\n```swift\nlet myColor = UIColor(hex: \"#ffafc2\")\nlet myColorBlueComponent = myColor.blueComponent\nlet myColorGreenComponent = myColor.greenComponent\nlet myColorRedComponent = myColor.redComponent\nlet myColorAlphaComponent = myColor.alphaComponent\n```\n\n#### Blending\n```swift\nlet red = UIColor.redColor()\nlet green = UIColor.greenColor()\nlet yellow = red.addRGB(green)\n\nlet desaturatedBlue = UIColor(hex: \"#aaaacc\")\nlet saturatedBlue = desaturatedBlue.addHue(0.0, saturation: 1.0, brightness: 0.0, alpha: 0.0)\n```\n\n## Supporting the project\n\nIf you want to support the development of this framework, you can do so by becoming a [sponsor](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fzenangst). ❤️\n\n## Examples\n\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fhyperoslo\u002FHue\u002Fmaster\u002FImages\u002Fhex-screenshot.png\" alt=\"Hex Example screenshot\" align=\"right\" \u002F>\n\n#### Hex\nThis super simple example that displays a bunch of color schemes in a Carousel view.\n\nIt uses hex to set the color for the schemes. It leverages from `.isDarkColor` to make the text color readable in all scenarios.\n\nThe demo also features [Spots](http:\u002F\u002Fgithub.com\u002Fhyperoslo\u002FSpots) for rendering the Carousel view.\n\n**Example code:**\n\n```swift\nlet color = UIColor(hex: \"#3b5998\")\nbackgroundColor = color\nlabel.textColor = color.isDark\n  ? UIColor.whiteColor()\n  : UIColor.darkGrayColor()\n```\n\n#### Gradients\n\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fhyperoslo\u002FHue\u002Fmaster\u002FImages\u002Fgradients-screenshot.gif\" alt=\"Gradients Example screenshot\" align=\"right\" width=\"236\" \u002F>\n\nThis examples shows how much fun you can have with combining `CAGradientLayer` with `CABasicAnimation`.\n\nIt uses `.hex` for getting the colors and `.gradient()` for transforming\na collection of `UIColor`'s into a `CAGradientLayer`.\n\nThe demo features [Spots](http:\u002F\u002Fgithub.com\u002Fhyperoslo\u002FSpots) for rendering the list view and [Fakery](https:\u002F\u002Fgithub.com\u002Fvadymmarkov\u002FFakery) for generating random content strings.\n\n**Extract from the demo:**\n```swift\nlazy var gradient: CAGradientLayer = [\n  UIColor(hex: \"#FD4340\"),\n  UIColor(hex: \"#CE2BAE\")\n  ].gradient { gradient in\n    gradient.speed = 0\n    gradient.timeOffset = 0\n\n    return gradient\n  }\n```\n\n## Installation\n\n**Hue** is available through [CocoaPods](http:\u002F\u002Fcocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'Hue'\n```\n\n**Hue** is also available through [Carthage](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage).\nTo install just write into your Cartfile:\n\n```ruby\ngithub \"hyperoslo\u002FHue\"\n```\n\nTo install **Hue** using [Swift Package Manager](https:\u002F\u002Fswift.org\u002Fpackage-manager) with Xcode 11, just follow the instructions at \u003Chttps:\u002F\u002Fdeveloper.apple.com\u002Fdocumentation\u002Fswift_packages> and import the platform specific library to the project:\n\n```swift\nimport Hue\n```\n\n## Author\n\n[Hyper](http:\u002F\u002Fhyper.no) made this with ❤️\n\n## Contribute\n\nWe would love you to contribute to **Hue**, check the [CONTRIBUTING](https:\u002F\u002Fgithub.com\u002Fhyperoslo\u002FHue\u002Fblob\u002Fmaster\u002FCONTRIBUTING.md) file for more info.\n\n## Credits\n\nCredit goes out to Panic Inc who created [ColorArt](https:\u002F\u002Fgithub.com\u002Fpanicinc\u002FColorArt) and [@jathu](https:\u002F\u002Fgithub.com\u002Fjathu) for his work on [UIImageColors](https:\u002F\u002Fgithub.com\u002Fjathu\u002FUIImageColors) which deeply inspired the functionality behind the image color analysis.\n\n## License\n\n**Hue** is available under the MIT license. See the LICENSE file for more info.\n","Hue 是一个全面的颜色处理工具，旨在满足所有颜色相关的开发需求。它支持多种核心功能，包括通过十六进制初始化颜色、计算颜色属性（如是否为深色或黑白）、调整透明度、创建渐变层以及从图片中提取颜色等。此外，Hue 还提供了便捷的方法来获取和修改颜色的各个组件（红、绿、蓝、透明度）。该库使用 Swift 语言编写，兼容 CocoaPods 和 Carthage 等依赖管理工具，适用于 iOS 和 macOS 平台上的任何需要进行颜色操作的应用场景。","2026-06-11 03:09:50","top_language"]