{"id":13338708,"url":"https://github.com/artem-y/hexcode","last_synced_at":"2026-01-16T16:57:53.938Z","repository":{"id":214901121,"uuid":"654759329","full_name":"artem-y/hexcode","owner":"artem-y","description":"A tool that finds Xcode color assets by hex code","archived":false,"fork":false,"pushed_at":"2025-01-15T08:30:28.000Z","size":2567,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T10:39:22.082Z","etag":null,"topics":["cli","color-assets","hex","ios","macos","rgb","swift-package-manager","tvos","visionos","watchos","xcode","xcodeproj","xcworkspace"],"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/artem-y.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-16T22:13:43.000Z","updated_at":"2025-01-14T23:49:48.000Z","dependencies_parsed_at":"2024-10-23T20:39:02.152Z","dependency_job_id":"242f4e9d-3858-4d68-9eea-272882b436a6","html_url":"https://github.com/artem-y/hexcode","commit_stats":null,"previous_names":["artem-y/hexcode"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/artem-y/hexcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artem-y%2Fhexcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artem-y%2Fhexcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artem-y%2Fhexcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artem-y%2Fhexcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artem-y","download_url":"https://codeload.github.com/artem-y/hexcode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artem-y%2Fhexcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cli","color-assets","hex","ios","macos","rgb","swift-package-manager","tvos","visionos","watchos","xcode","xcodeproj","xcworkspace"],"created_at":"2024-07-29T19:17:08.654Z","updated_at":"2026-01-16T16:57:53.911Z","avatar_url":"https://github.com/artem-y.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"  \n  \n\u003cimg src=\"Tests/hexcodeTests/Resources/Assets.xcassets/hexcode_logo.imageset/hexcode_logo@3x.png\" width=25% align=\"center\"\u003e  \nA tool that finds Xcode color assets by their hex codes. The idea behind this tool is to speed up and ease the process of finding assets that were already added to the project. This helps prevent accidental duplication when there are too many color assets to go through and they are easy to miss because they have different component representations.\n\n\u003cp align=\"center\"\u003e\n    \u003cbr /\u003e\n    \u003cimg alt-text=\"Swift Version\" src=\"https://img.shields.io/badge/Swift-5.9-orange.svg\"\u003e\n    \u003ca href=\"https://github.com/artem-y/hexcode/releases/latest\"\u003e\u003cimg alt-text=\"GitHub Release\" src=\"https://img.shields.io/github/v/release/artem-y/hexcode\"\u003e\u003c/a\u003e\n    \u003cimg alt-text=\"Minimal macOS Version\" src=\"https://img.shields.io/badge/macOS-13%2B-e08416\"\u003e\n\u003c/p\u003e\n\n### ⚠️Disclaimer:\nFor now, the tool only supports searching for exact values of color components as ints, floats or hexadecimals, without conversion between settings like content type (sRGB, Display P3, Gray Gamma 2.2 etc.), and ignoring some other settings like Gamut etc.  \n## Usage\nBy default, the tool can be used from the terminal to search for matches to a given color code:\n```\nhexcode #ffa500\n```\n...where `#ffa500` is a hex color code, with or without `#`, case-insensitive.  \n\nWhen used this way, `hexcode` will recursively search for the color assets matching the hex rgb value, starting from the current directory. The output will be one or more matching color set names, or a message in case it haven't found an asset with the given color. Color names include path to their color asset, relative to the project. The command also has some very simple error handling and might exit with error.  \nMore arguments and options will be added in the future with new features, they can be found using the `--help` flag.  \n#### Default usage examples\nColor found:  \n\u003cimg width=\"568\" alt=\"hexcode_usage_color_found_1\" src=\"https://github.com/user-attachments/assets/5a25b195-c981-4048-8b4b-e17b8df10a25\" /\u003e\n\nColor not found:  \n\u003cimg width=\"570\" alt=\"hexcode_usage_no_such_color\" src=\"https://github.com/artem-y/hexcode/assets/52959979/77a36d4c-9480-4603-9ae2-8a6bce410a4e\"\u003e  \n\n### Find Duplicates\nHexcode can also check a project or a directory for duplicated color assets.\n```zsh\nhexcode find-duplicates\n```\nOutput example when there are duplicates:\n```\n#24658F MyProject/Assets.xcassets/AccentColor\n#24658F MyProject/Colors.xcassets/defaultAccent\n--\n#999999 MyProject/Assets.xcassets/appColor/gray\n#999999 MyProject/Colors.xcassets/neutralGray\n```\nOutput when duplicates not found:\n```\nNo duplicates found\n```\n\n## Installation\n1. Clone the repository to your machine\n2. Assuming the folder name \"hexcode\" has not changed, run in terminal:\n```\ncd hexcode\n```\n### Using Swift Package Manager:\nThen run the following:\n```\nswift build -c release\nmv .build/release/hexcode /usr/local/bin\n```\n(you might need `sudo` before the `mv` command, depending on your machine's configuration) \n\n3. Run `which hexcode` to make sure it is now visible  \n\nAlternatively, it can be moved to some directory other than `/usr/local/bin`, just make sure that directory is included in `$PATH` if you want it visible from anywhere in terminal.  \nOr you can just run it as an executable Swift package [without installation](#running-without-installation), using Swift Package Manager commands.\n### Using make:\nFrom the root of the repository, run the following command:\n```\nmake install\n```\nWith no installation path provided, it will try to install `hexcode` to where it's already installed. If this is the first-time installation, the default path is `/usr/local/bin`.  \n\nThere's also an option to provide a custom installation path:\n```\nmake install \u003c/custom/installation/path\u003e\n```\nJust make sure it's added to the PATH or sourced if you want the command to be visible from anywhere without typing the full path to it. Depending on the installation path and current user, `make install` command might need `sudo` access.\n### Running without installation:\nFrom the `hexcode` directory (or passing it as `--package-path`), the command can be run as executable package without previous installation, for example:\n```\nswift run hexcode e8de2a --directory=$HOME/Documents/myProject\n```\n## Testing\n\u003cp align=\"right\"\u003e\n\u003ci\u003e- \"If it is not tested, I will send it back.\"\u003cbr\u003e\n- \"If tests don't pass, I will send it back.\"\u003c/i\u003e\n\u003c/p\u003e\n\nTests should work both from Xcode (Cmd+U after opening `Package.swift`) and Terminal:  \n```\nswift test\n```\nCore logic must be covered with tests that help decrease regression when developing new features, and also help understand how the app works.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartem-y%2Fhexcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartem-y%2Fhexcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartem-y%2Fhexcode/lists"}