{"id":18924099,"url":"https://github.com/jonyfang/ffcolorswift","last_synced_at":"2025-08-12T06:46:15.408Z","repository":{"id":115372679,"uuid":"165205930","full_name":"JonyFang/FFColorSwift","owner":"JonyFang","description":"A lightweight color extension written in Swift. ","archived":false,"fork":false,"pushed_at":"2019-03-19T07:04:41.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T09:32:11.146Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/JonyFang.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-01-11T08:17:37.000Z","updated_at":"2019-03-19T06:58:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"becceafa-2d2d-4fac-9064-1bed2b525e96","html_url":"https://github.com/JonyFang/FFColorSwift","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/JonyFang/FFColorSwift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonyFang%2FFFColorSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonyFang%2FFFColorSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonyFang%2FFFColorSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonyFang%2FFFColorSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JonyFang","download_url":"https://codeload.github.com/JonyFang/FFColorSwift/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonyFang%2FFFColorSwift/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270016499,"owners_count":24512962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-08T11:05:48.367Z","updated_at":"2025-08-12T06:46:15.341Z","avatar_url":"https://github.com/JonyFang.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FFColorSwift\n\nA lightweight color extension write in Swift.\n\n## Requirements\n\n- iOS 8.0+ / macOS 10.13.6+\n- Xcode 10.1 (10B61) +\n\n## Installation\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org/) is a dependency manager, which automates and simplifies the process of using 3rd-party libraries like FFColorSwift in your projects. First, add the following line to your [Podfile](http://guides.cocoapods.org/using/using-cocoapods.html):\n\n```\npod 'FFColorSwift'\n```\n\n### Carthage\n\nTo integrate `FFColorSwift` into your Xcode project using [Carthage](https://github.com/Carthage/Carthage), specify it in your `Cartfile`:\n\n```\ngithub \"JonyFang/FFColorSwift\"\n```\n\n### Manually\n\nYou can also integrate `FFColorSwift` directly with souce code. Clone the repo and copy `FFColorSwift.swift` to your project.\n\n## Usage\n\n### Initialize with Hex String\n\n```swift\nColor(\"000\")\nColor(\"000C\")\nColor(\"0x4DA2D9\")\nColor(hexString: \"#4DA2D9\")\nColor(hexString: \"#4DA2D9CC\")\n\nColor(hexString: \"#4DA2D9\", alpha: 0.8)\n\n\"#4DA2D9CC\".color\n```\n\n### Initialize with Hex Int\n\n```swift\nColor(hexInt: 0x4DA2D9)\n\nColor(hexInt: 0x4DA2D9, alpha: 0.8)\n\n(0x4DA2D9).color\n```\n\n### Initialize with RGBA\n\n```swift\nColor(byteRed: 77, green: 162, blue: 217, alpha: 0.8)\n```\n\n### Get/Change Color Components\n\n```swift\nlet color = Color(hexString: \"#4DA2D9CC\")\n\n// Get color components\nvar (r, g, b, a) = color.colorComponents()\n\n// Change color components\nvar red = \"000\".color.red(255)\nvar alphaColor = Color(hexInt: 0x4DA2D9).alpha(0.8)\n```\n\n### Convert to image\n\n```swift\nlet image = \"000\".color.toImage()\n```\n\n## License\n\nFFColorSwift is available under the MIT license. See the [LICENSE](./LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonyfang%2Fffcolorswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonyfang%2Fffcolorswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonyfang%2Fffcolorswift/lists"}