{"id":2170,"url":"https://github.com/Draveness/NightNight","last_synced_at":"2025-08-02T23:32:09.390Z","repository":{"id":41519381,"uuid":"61882907","full_name":"draveness/NightNight","owner":"draveness","description":"Elegant way to integrate night mode to swift projects","archived":true,"fork":false,"pushed_at":"2019-10-02T20:13:50.000Z","size":14787,"stargazers_count":777,"open_issues_count":17,"forks_count":62,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-04-29T19:42:40.429Z","etag":null,"topics":["carthage","cocoapods","color","night-mode","swift","theme"],"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/draveness.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":"2016-06-24T12:26:24.000Z","updated_at":"2024-03-07T02:40:46.000Z","dependencies_parsed_at":"2022-09-21T11:50:31.330Z","dependency_job_id":null,"html_url":"https://github.com/draveness/NightNight","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draveness%2FNightNight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draveness%2FNightNight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draveness%2FNightNight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/draveness%2FNightNight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/draveness","download_url":"https://codeload.github.com/draveness/NightNight/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503142,"owners_count":17930520,"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":["carthage","cocoapods","color","night-mode","swift","theme"],"created_at":"2024-01-05T20:16:06.484Z","updated_at":"2024-12-06T17:30:50.045Z","avatar_url":"https://github.com/draveness.png","language":"Swift","funding_links":[],"categories":["Style","UI"],"sub_categories":["Other free courses","Font","Other Testing"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./images/Banner.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://travis-ci.org/Draveness/NightNight\"\u003e\u003cimg alt=\"Travis Status\" src=\"https://travis-ci.org/Draveness/NightNight.svg?branch=master\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://img.shields.io/cocoapods/v/NightNight.svg\"\u003e\u003cimg alt=\"CocoaPods compatible\" src=\"https://img.shields.io/cocoapods/v/NightNight.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/Carthage/Carthage\"\u003e\u003cimg alt=\"Carthage compatible\" src=\"https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://img.shields.io/cocoapods/p/NightNight.svg?style=flat\"\u003e\u003cimg alt=\"Platform\" src=\"https://img.shields.io/cocoapods/p/NightNight.svg?style=flat\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n**NightNight** makes it easy to integrate night mode. It provides multiple APIs which all contain keyword **mixed**.\n\n\u003e If you want to implement night mode in Objective-C project without import swift code.\n\u003e This is the Objective-C version [DKNightVersion](https://github.com/Draveness/DKNightVersion)\n\n```swift\nlet view = UIView()\nview.mixedBackgroundColor = MixedColor(normal: 0xffffff, night: 0x000000)\n\nlet imageView = UIImageView()\nimageView.mixedImage = MixedImage(normal: UIImage(named: \"normal\"), night: UIImage(named: \"night\")) \n```\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e • \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e • \u003ca href=\"#customize\"\u003eCustomize\u003c/a\u003e • \u003ca href=\"#demo\"\u003eDemo\u003c/a\u003e • \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e • \u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n\u003c/p\u003e\n\n## Features\n\n- [x] Integrate night mode easily\n- [x] UIColor and UIImage support\n- [x] Support NSAttributedString\n- [x] Better autocompletion\n- [x] Customize with notification\n\n## Usage\n\n+ Use `MixedColor` instead of `UIColor`\n\n    ```swift\n    let view = UIView()\n    \n    view.mixedBackgroundColor = MixedColor(normal: 0xffffff, night: 0x000000)\n    ```\n\n+ Use `MixedImage` instead of `UIImage`\n\n    ```swift\n    let imageView = UIImageView()\n    \n    imageView.mixedImage = MixedImage(normal: normal, night: night)\n    ```\n\n+ Support `NSAttributedString`\n\n    ```swift\n    let attributedString = NSMutableAttributedString(string: \"NightNight\")\n    attributedString.setMixedAttributes(\n        [NNForegroundColorAttributeName: MixedColor(normal: 0x000000, night: 0xfafafa)],\n        range: NSRange(location: 0, length: 9)\n    )\n    \n    public let NNForegroundColorAttributeName\n    public let NNBackgroundColorAttributeName\n    public let NNUnderlineColorAttributeName\n    ```\n\n+ `NavigationBar` barStyle\n\n    ```swift\n    let navigationBar = navigationController?.navigationBar\n\n    navigationBar.mixedBarStyle = MixedBarStyle(normal: .Default, night: .Black)\n    ```\n\n+ Change current theme to `.NORMAL` or `.NIGHT`\n\n    ```swift\n    NightNight.theme = .NORMAL\n    NightNight.theme = .NIGHT\n    ```\n\n## Customize\n\nNightNight will send `NightNightThemeChangeNotification`. if you wanna some customize features, you can observe it and change what you want in corresponding selector.\n\n```swift\npublic let NightNightThemeChangeNotification\n```\n\n## Demo\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./images/Demo.gif\"\u003e\n\u003c/p\u003e\n\n## Installation\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.\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 NightNight into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"draveness/NightNight\"\n```\n\n### Cocoapods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects.\n\nYou can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nTo integrate NightNight into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nuse_frameworks!\n\npod 'NightNight'\n```\n\n### Manually\n1. Download and drop ```NightNight/Classes```folder in your project.  \n2. Congratulations!  \n\n## License\n\nCopyright (c) 2016 Draveness (http://github.com/draveness)\n\nNightNight is available under the MIT license. See the LICENSE file for more info.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDraveness%2FNightNight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDraveness%2FNightNight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDraveness%2FNightNight/lists"}