{"id":13649103,"url":"https://github.com/mRs-/HexColors","last_synced_at":"2025-04-22T12:33:24.081Z","repository":{"id":5758720,"uuid":"6971630","full_name":"mRs-/HexColors","owner":"mRs-","description":" HexColors is an extension for UIColor and NSColor to support for creating colors from a hex strings","archived":false,"fork":false,"pushed_at":"2022-09-01T16:09:00.000Z","size":180,"stargazers_count":457,"open_issues_count":5,"forks_count":102,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-10-29T12:42:53.425Z","etag":null,"topics":["extension","hex","hex-strings","ios","macos","nscolor","swift","uicolor"],"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/mRs-.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-02T20:10:04.000Z","updated_at":"2024-08-09T07:51:44.000Z","dependencies_parsed_at":"2022-11-28T10:34:02.386Z","dependency_job_id":null,"html_url":"https://github.com/mRs-/HexColors","commit_stats":null,"previous_names":["mrs-/mluicoloradditions"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mRs-%2FHexColors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mRs-%2FHexColors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mRs-%2FHexColors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mRs-%2FHexColors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mRs-","download_url":"https://codeload.github.com/mRs-/HexColors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223896472,"owners_count":17221441,"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":["extension","hex","hex-strings","ios","macos","nscolor","swift","uicolor"],"created_at":"2024-08-02T01:04:46.885Z","updated_at":"2024-11-09T23:30:55.423Z","avatar_url":"https://github.com/mRs-.png","language":"Swift","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"HexColors.png\" alt=\"HexColors\" title=\"HexColors\"\u003e\n\u003c/p\u003e\n\n[![Platform](https://img.shields.io/badge/platform-iOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20macOS-lightgrey.svg)](https://github.com/mrs-/HexColors)\n[![Xcode](https://img.shields.io/badge/Xcode-9.0-blue.svg)](https://developer.apple.com/xcode)\n[![Swift](https://img.shields.io/badge/Swift-4.0-orange.svg)](https://swift.org)\n![Downloads Month](https://img.shields.io/cocoapods/dm/HexColors.svg)\n![Cocoapods](https://cocoapod-badges.herokuapp.com/v/HexColors/badge.png)\n[![Build Status](https://travis-ci.org/mRs-/HexColors.svg?branch=master)](https://travis-ci.org/mrs-/HexColors)\n[![codecov](https://codecov.io/gh/mRs-/HexColors/branch/master/graph/badge.svg)](https://codecov.io/gh/mRs-/HexColors)\n\nHexColors is an extension for UIColor and NSColor to support for creating colors from a hex string like #FF0088 or 8844FF and back to a String. Completely rewritten in Swift 3!\n\nIf you want to use this in Objective-C jump to the 4.X version tag.\nIf you want to use this in Swift \u003c 3.2 use the 5.X version tag.\n\n# RELEASE 6.0.0\nSwift 4.0 compatiblity\n\n# Examples\nHow to use HexColors in the different systems.\n\n## iOS / watchOS / tvOS\n\n### Generating UIColors\n\n``` swift\nlet colorWithHex = UIColor(\"#ff8942\")\nlet colorWithoutHex = UIColor(\"ff8942\")\nlet colorWithHexAndAlhpa = UIColor(\"#ff8942DF\")\nlet colorWithoutHexAndAlhpa = UIColor(\"ff8942DF\")\nlet shortColorWithHex = UIColor(\"#fff\")\nlet shortColorWithoutHex = UIColor(\"fff\")\nlet shortColorWithHexAndAlpha = UIColor(\"#FFFD\")\nlet shortColorWithoutHexAndAlpha = UIColor(\"#FFFD\")\n```\n\n### Generating Hex Strings from UIColor\n``` swift\nlet colorWithHex = UIColor(\"#ff8942\")\nlet stringFromColor = colorWithHex.hex\n```\n\n## macOS\n\n### Generating NSColor\n``` swift\nlet colorWithHex = NSColor(\"#ff8942\")\nlet colorWithoutHex = NSColor(\"ff8942\")\nlet colorWithHexAndAlhpa = NSColor(\"#ff8942DF\")\nlet colorWithoutHexAndAlhpa = NSColor(\"ff8942DF\")\nlet shortColorWithHex = NSColor(\"#fff\")\nlet shortColorWithoutHex = NSColor(\"fff\")\nlet shortColorWithHexAndAlpha = NSColor(\"#FFFD\")\nlet shortColorWithoutHexAndAlpha = NSColor(\"#FFFD\")\n```\n\n### Generating Hex Strings from NSColor\n``` swift\nlet colorWithHex = NSColor(\"#ff8942\")\nlet stringFromColor = colorWithHex.hex\n```\n\n# Installation\n\n## Requirements\nHexColors requires **\u003e= iOS 8.0** and **\u003e=macOS 10.9**.\n\n## Cocoapods\nAdd HexColors to your Podfile:\n``` ruby\npod 'HexColors'\n```\n* `pod install HexColors`\n\n## Carthage\nAdd HexColors to your Cartfile:\n```\ngithub \"mRs-/HexColors\"\n```\n\n## Swift Package Manager\nTo work with the Swift Package Manager you need to add a Package.swift file and defining your package.\n\n``` swift\nimport PackageDescription\n\nlet package = Package(\n    name: \"YourPackageName\",\n    dependencies: [\n        .Package(url: \"https://github.com/mRs-/HexColors\", majorVersion: 5),\n    ]\n)\n```\n\nThen execute the Swift Package Manager with the following Shell commands:\n``` bash\nswift build\n.build/debug/YourPackageName\n``` \n\n## Manual\nSimply just drag and drop the HexColors.swift in your project.\n\n# Credits\nHexColors was created by [Marius Landwehr](https://github.com/mRs-) because of the pain to create Colors from a API (mostly hex) converting to a UI/NSColor.\n\n# Creator\n[Marius Landwehr](https://github.com/mRs-) [@mariusLAN](https://twitter.com/mariusLAN)\n\n# License\nHexColors is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FmRs-%2FHexColors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FmRs-%2FHexColors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FmRs-%2FHexColors/lists"}