{"id":13508593,"url":"https://github.com/Kabie/dye","last_synced_at":"2025-03-30T11:32:20.206Z","repository":{"id":24254766,"uuid":"27648367","full_name":"Kabie/dye","owner":"Kabie","description":"Dyeing your terminal!","archived":false,"fork":false,"pushed_at":"2024-03-02T18:31:26.000Z","size":142,"stargazers_count":21,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T02:21:09.583Z","etag":null,"topics":["elixir"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kabie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2014-12-06T20:37:43.000Z","updated_at":"2024-03-02T18:23:05.000Z","dependencies_parsed_at":"2024-03-02T19:32:24.001Z","dependency_job_id":"7976c48f-d1e1-4b5f-b839-7bccc0a97ba9","html_url":"https://github.com/Kabie/dye","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"c6ce8f9088fc569831acfdaf68bdce2690d768e4"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kabie%2Fdye","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kabie%2Fdye/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kabie%2Fdye/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kabie%2Fdye/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kabie","download_url":"https://codeload.github.com/Kabie/dye/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314011,"owners_count":20757450,"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":["elixir"],"created_at":"2024-08-01T02:00:55.335Z","updated_at":"2025-03-30T11:32:17.489Z","avatar_url":"https://github.com/Kabie.png","language":"Elixir","funding_links":[],"categories":["Miscellaneous"],"sub_categories":[],"readme":"Dye\n===\n\nNote: This lib uses uppercase sigil modifiers. So only works with elixir \u003e= 1.1.0.\n\n`use Dye` will replaces sigils: `~s` and `~S`.\n\n\n## Usage\n\n```elixir\niex(1)\u003e use Dye\nDye\n\niex(2)\u003e ~s\"Red text\"r\n\"\\e[31mRed text\\e[0m\"\n\niex(3)\u003e ~s\"Bright red text\"R\n\"\\e[91mBright red text\\e[0m\"\n\niex(4)\u003e ~s\"Bright red text with green background\"Rg\n\"\\e[42;91mBright red text with green background\\e[0m\"\n\niex(5)\u003e ~s\"Underline\"u\n\"\\e[4mUnderline\\e[0m\"\n\niex(6)\u003e ~s\"Underline red text\"ur\n\"\\e[31;4mUnderline red text\\e[0m\"\n\niex(7)\u003e ~s\"Underline red text with bright green background\"urG\n\"\\e[102;31;4mUnderline red text with bright green background\\e[0m\"\n```\n\n\n## Color Modifiers\n\n\u003e $ mix test\n\n![Color modifiers demo](https://github.com/Kabie/dye/raw/master/priv/demo.png)\n\nThe first color modifier will be used as text color. If you only want to set background, you can set text then use `I` to inverse the color.\n\n```\nd: Default\nk: Black\nr: Red\ng: Green\ny: Yellow\nb: Blue\nm: Magenta\nc: Cyan\nw: White\nK: Bright Black\nR: Bright Red\nG: Bright Green\nY: Bright Yellow\nB: Bright Blue\nM: Bright Magenta\nC: Bright Cyan\nW: Bright White\n```\n\n\n## Special Modifiers\n\n```\ne: Don't reset at the end\nI: Inverse text and background color\nD: Bold\ni: Italic\nu: Underline\nl: Blink slow\nL: Blink rapid\n```\n\n\n## Call `sigil_s/sigil_S` directly\n\nThe default implementation uses macro, which limits the modifiers can only be char list literal. The following won't work:\n\n```elixir\nmods = 'Rg'\nsigil_S(\u003c\u003c\"foo\"\u003e\u003e, mods)\n```\n\nTo use the function implementation, simply do:\n\n```elixir\nuse Dye, func: true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKabie%2Fdye","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKabie%2Fdye","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKabie%2Fdye/lists"}