{"id":32149522,"url":"https://github.com/pducks32/pailead","last_synced_at":"2026-02-19T08:01:55.862Z","repository":{"id":56921351,"uuid":"112095526","full_name":"pducks32/Pailead","owner":"pducks32","description":"A palette generating and extraction Swift library for macOS, iOS, and Linux","archived":false,"fork":false,"pushed_at":"2019-05-12T10:27:36.000Z","size":302,"stargazers_count":7,"open_issues_count":5,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T09:59:01.523Z","etag":null,"topics":["extraction","palette","palette-library","swatches","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pducks32.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-26T15:50:18.000Z","updated_at":"2021-10-17T09:44:06.000Z","dependencies_parsed_at":"2022-08-20T21:50:28.516Z","dependency_job_id":null,"html_url":"https://github.com/pducks32/Pailead","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/pducks32/Pailead","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pducks32%2FPailead","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pducks32%2FPailead/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pducks32%2FPailead/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pducks32%2FPailead/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pducks32","download_url":"https://codeload.github.com/pducks32/Pailead/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pducks32%2FPailead/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29608152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["extraction","palette","palette-library","swatches","swift"],"created_at":"2025-10-21T09:58:59.428Z","updated_at":"2026-02-19T08:01:55.842Z","avatar_url":"https://github.com/pducks32.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pailead\n[![Version](https://img.shields.io/cocoapods/v/Pailead.svg?style=flat)](http://cocoapods.org/pods/Pailead)\n[![License](https://img.shields.io/cocoapods/l/Pailead.svg?style=flat)](http://cocoapods.org/pods/Pailead)\n[![Platform](https://img.shields.io/cocoapods/p/Pailead.svg?style=flat)](http://cocoapods.org/pods/Pailead)\n\nPailead works just like the Palette library on Android and other tools like node-vibrant but is\ncompletely written in Swift and optimized for macOS, iOS, tvOS, and even watchOS. \n\n## Installation\n\n### CocoaPods\n\n[CocoaPods](https://cocoapods.org/) is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate Pailead into your Xcode project using CocoaPods, specify it in your Podfile:\n\n```ruby\npod \"Pailead\"\n```\n\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.\n\nOnce you have your Swift package set up, adding Pailead as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n#### Swift 4\n\n```swift\ndependencies: [\n.package(url: \"https://github.com/pducks32/Pailead.git\", from: \"1.4.0\")\n]\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate Pailead into your Xcode project using Carthage, specify it in your Cartfile:\n\n```ogdl\ngithub \"pducks32/Pailead\"\n```\n\n## Usage\n### Extracting Palette\nAll images are resized to 1000 pixels to speed up extraction, but don't worry this hasn't been shown to degrade the quality of the palette.\n```swift\nlet image = \u003c#Image#\u003e\nPailead.extractPalette(from: image) { palette in\n\u003c#Do Something with Palette#\u003e\n}\n```\n### Palette Swatches\nThe generated palette generates useful swatches to use in your UI or as a loading background perhaps.\nAll swatches are actual colors found in the MMCQ calculation though it will generate some if no suitable ones can be found.\nThese are:\n- Muted Swatch (middle range luma and low saturation)\n- Dark Muted Swatch (low range luma)\n- Light Muted Swatch (high range luma)\n- Vibrant Swatch (middle range luma and high saturation)\n- Dark Vibrant Swatch (low range luma)\n- Light Vibrant Swatch (high range luma)\n\n## How it works\n### Modified Mean Cut Quantization\nThat's a big word. The image's pixels are grouped and counted.\nThen they are laid out in RGB space. From there the quantizer finds\nRGB boxes that encapsulate the pixels equally. From these boxes the\naverage color is generated and then sorted by how common it is in the image.\n\n\n## Todo\n- [x] Switch to swatches\n- [x] Add palette\n- [ ] Paralleize pixel extraction (clustering is already parallized)\n- [ ] Add more performance tests\n- [ ] Make better docs with example uses\n- [ ] Optimize processing loop\n- [ ] Add support for other clustering algorithms\n\n## Name\n\nIf palette is pronounced *pa-let* then Pailead is pronounced *pa-lid*.\n\nThe word comes from the Irish word paileád meaning palette which is what this library extracts.\n\n## Author\n- @pducks32 (Patrick Metcalfe, git@patrickmetcalfe.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpducks32%2Fpailead","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpducks32%2Fpailead","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpducks32%2Fpailead/lists"}