{"id":900,"url":"https://github.com/thii/SwiftHEXColors","last_synced_at":"2025-08-06T13:32:02.651Z","repository":{"id":21471295,"uuid":"24789822","full_name":"thii/SwiftHEXColors","owner":"thii","description":"HEX color handling as an extension for UIColor.","archived":false,"fork":false,"pushed_at":"2022-10-05T19:03:31.000Z","size":208,"stargazers_count":692,"open_issues_count":4,"forks_count":97,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-05-02T01:11:37.205Z","etag":null,"topics":[],"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/thii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["thii"]}},"created_at":"2014-10-04T13:10:33.000Z","updated_at":"2024-04-27T09:04:24.000Z","dependencies_parsed_at":"2022-07-27T02:32:14.398Z","dependency_job_id":null,"html_url":"https://github.com/thii/SwiftHEXColors","commit_stats":null,"previous_names":["thii/swiftcolors"],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thii%2FSwiftHEXColors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thii%2FSwiftHEXColors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thii%2FSwiftHEXColors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thii%2FSwiftHEXColors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thii","download_url":"https://codeload.github.com/thii/SwiftHEXColors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227303032,"owners_count":17761151,"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","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-01-05T20:15:34.236Z","updated_at":"2024-12-09T14:30:43.493Z","avatar_url":"https://github.com/thii.png","language":"Swift","funding_links":["https://github.com/sponsors/thii"],"categories":["Color","Libs","UI and SwiftUI","Colors [🔝](#readme)"],"sub_categories":["Linter","Colors","Other free courses"],"readme":"SwiftHEXColors\n===========\n\n[![Build Status](http://img.shields.io/travis/thii/SwiftHEXColors.svg?style=flat)](https://travis-ci.org/thii/SwiftHEXColors)\n[![Swift Package Manager Compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-4BC51D.svg?style=flat)](https://github.com/apple/swift-package-manager)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/SwiftHEXColors.svg)](https://img.shields.io/cocoapods/v/SwiftHEXColors.svg)\n[![Docs](https://img.shields.io/cocoapods/metrics/doc-percent/SwiftColors.svg)](http://cocoadocs.org/docsets/SwiftHEXColors)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Platform](https://img.shields.io/cocoapods/p/SwiftHEXColors.svg?style=flat)](http://cocoadocs.org/docsets/SwiftHEXColors)\n[![License](https://img.shields.io/cocoapods/l/SwiftHEXColors.svg)](https://raw.githubusercontent.com/thii/SwiftHEXColors/master/LICENSE)\n\nHEX color handling as an extension for UIColor. Written in Swift.\n\n## Examples\n### iOS\n``` swift\n// With hash\nlet color: UIColor = UIColor(hexString: \"#ff8942\")\n\n// Without hash, with alpha\nlet secondColor: UIColor = UIColor(hexString: \"ff8942\", alpha: 0.5)\n\n// Short handling\nlet shortColorWithHex: UIColor = UIColor(hexString: \"fff\")\n```\n\nFor those who don't want to type the double quotation, you can init a color from a real hex value (an `Int`)\n\n```swift\n// With hash\nlet color: UIColor = UIColor(hex: 0xff8942)\n\n// Without hash, with alpha\nlet secondColor: UIColor = UIColor(hex: 0xff8942, alpha: 0.5)\n```\n\n### OSX\n``` swift\n// With hash\nlet color: NSColor = NSColor(hexString: \"#ff8942\")\n\n// Without hash, with alpha\nlet secondColor: NSColor = NSColor(hexString: \"ff8942\", alpha: 0.5)\n\n// Short handling\nlet shortColorWithHex: NSColor = NSColor(hexString: \"fff\")\n\n// From a real hex value (an `Int`)\n// With hash\nlet color: NSColor = NSColor(hex: 0xff8942)\n\n// Without hash, with alpha\nlet secondColor: NSColor = NSColor(hex: 0xff8942, alpha: 0.5)\n```\n\n## Installation\n\n### Swift Package Manager\n\nAdd this as a dependency in your `Package.swift`:\n\n```swift\nimport PackageDescription\n\nlet package = Package(\n    name: \"MyPackage\",\n        dependencies: [\n        // Other dependencies\n\t.package(url: \"https://github.com/thii/SwiftHEXColors.git\", from: \"1.3.1\")\n    ]\n)\n```\n\n### CocoaPods\n\nTo integrate SwiftHEXColors into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '8.0'\nuse_frameworks!\n\npod 'SwiftHEXColors'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\nAnd add `import SwiftHEXColors` to the top of the files using SwiftHEXColors.\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.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate SwiftHEXColors into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"thii/SwiftHEXColors\"\n```\n\nRun `carthage update` to build the framework and drag the built `SwiftHEXColors.framework` into your Xcode project.\n\n### Manually\n- Drag and drop `SwiftHEXColors.swift` file into your project\n\n# Requirements\n- Swift 3\n- iOS 8.0 or above.\n\n# License\n[MIT](http://thi.mit-license.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthii%2FSwiftHEXColors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthii%2FSwiftHEXColors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthii%2FSwiftHEXColors/lists"}