{"id":21903879,"url":"https://github.com/hansemannn/titanium-dark-mode","last_synced_at":"2025-08-19T18:51:45.313Z","repository":{"id":142791333,"uuid":"190294215","full_name":"hansemannn/titanium-dark-mode","owner":"hansemannn","description":"Full support for iOS 13+ / Android 10+ dark mode (semantic colors and images) in Appcelerator Titanium","archived":false,"fork":false,"pushed_at":"2020-01-09T17:46:58.000Z","size":216,"stargazers_count":26,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T01:12:03.506Z","etag":null,"topics":["appcelerator","axway","darkmode","ios13","titanium"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/hansemannn.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,"publiccode":null,"codemeta":null}},"created_at":"2019-06-04T23:36:34.000Z","updated_at":"2021-07-14T02:23:05.000Z","dependencies_parsed_at":"2023-04-15T19:32:40.109Z","dependency_job_id":null,"html_url":"https://github.com/hansemannn/titanium-dark-mode","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-dark-mode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-dark-mode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-dark-mode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-dark-mode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hansemannn","download_url":"https://codeload.github.com/hansemannn/titanium-dark-mode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249151966,"owners_count":21221157,"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":["appcelerator","axway","darkmode","ios13","titanium"],"created_at":"2024-11-28T15:29:56.178Z","updated_at":"2025-04-15T20:44:14.860Z","avatar_url":"https://github.com/hansemannn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iOS 13+ Dark Mode in Titanium\n\nFull support for iOS 13+ dark mode in Titanium. Works for both semantic colors and images.\n\n\u003cimg src=\"./example.png\" alt=\"Example\" /\u003e\n\n## ⚠️ Note\n\nYou should only use this plugin if you want to support dark mode with a Titanium version \u003c 8.2.0. Titanium\n8.2.0 and later added support for dark mode based on this plugin internally, so this plugin isn't needed anymore.\n\n## The Magic\n\nThis project includes a CLI hook that generates semantic colors and images for the iOS Asset Catalog based on a JSON\nfile of colors that can even be used cross-platform and backwards compatible. It hooks into the SDK process\nbetween generating the asset catalog and compiling the app, so you can even change colors between builds\nwithout the need of clean-building the app again.\n\n## Requirements\n\nThe following project- and OS-requirements are necessary:\n\n- [x] Xcode 11+\n- [x] Asset Catalog enabled\n- [x] iOS 13+ (will fallback to `#000000` if called from older devices)\n- [x] Titanium SDK 8.0.0+\n- [x] A CLI plugin to hook into the asset catalog to generate the semantic colors\n- [x] A JSON file to curate the color styles\n\n## Installation\n\n- [x] Copy the contents of the `plugin/` directory (`colors`) to `\u003cproject\u003e/plugins`\n- [x] Link the `colors` plugin in your tiapp.xml:\n```xml\n\u003cti:app\u003e\n  \u003c!-- ... --\u003e\n  \u003cplugins\u003e\n    \u003c!-- ... --\u003e\n    \u003cplugin version=\"1.0\"\u003ecolors\u003c/plugin\u003e\n  \u003c/plugins\u003e\n\u003c/ti:app\u003e\n```\n- [x] Link the native `ti.darkmode` module to your project like any other native module\n- [x] Alloy: Copy your color JSON file to `\u003cproject\u003e/app/assets/json/colors.json`\n- [x] Classic: Copy your color JSON file to `\u003cproject\u003e/Resources/json/colors.json`\n- [x] For semantic images, make sure they are following the following scheme (`-dark` suffix):\n```sh\n# Default (Light)\nimage.png\nimage@2x.png\nimage@3x.png\n\n# Dark\nimage-dark.png\nimage-dark@2x.png\nimage-dark@3x.png\n```\n- [x] Map the colors on runtime for older devices or Android (this is just an example of how this could look like):\n```js\nfunction initializeColors() {\n  const colors = Alloy.Globals.colors = JSON.parse(Ti.Filesystem.getFile('json/colors.json').read());\n  const darkmode = OS_ANDROID ? undefined : require('ti.darkmode');\n\n  for (const color of Object.keys(colors)) {\n    Alloy.CFG.styles[color] = Utils.isiOSVersionOrGreater(13) ? darkmode.fetch(color) : colors[color].light;\n  }\n\n  // Use your colors like the following\n  myLabel.backgroundColor = Alloy.CFG.styles.backgroundColor\n}\n```\n\n## ToDos\n\n- [ ] Support sub-folders\n- [ ] This currently breaks incremental builds, because the Xcode project is changed after it's hash is stored\n\n## License\n\nMIT\n\n## Author\n\nHans Knöchel\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansemannn%2Ftitanium-dark-mode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhansemannn%2Ftitanium-dark-mode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansemannn%2Ftitanium-dark-mode/lists"}