{"id":31595273,"url":"https://github.com/escherize/ice","last_synced_at":"2025-10-06T03:59:09.011Z","repository":{"id":293094964,"uuid":"982926251","full_name":"escherize/ice","owner":"escherize","description":"💠 Iced out println","archived":false,"fork":false,"pushed_at":"2025-05-13T16:09:21.000Z","size":1825,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-13T17:25:52.408Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","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/escherize.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,"zenodo":null}},"created_at":"2025-05-13T15:55:44.000Z","updated_at":"2025-05-13T16:36:28.000Z","dependencies_parsed_at":"2025-05-13T17:36:00.376Z","dependency_job_id":null,"html_url":"https://github.com/escherize/ice","commit_stats":null,"previous_names":["escherize/ice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/escherize/ice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/escherize","download_url":"https://codeload.github.com/escherize/ice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escherize%2Fice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278556181,"owners_count":26006081,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-10-06T03:58:53.846Z","updated_at":"2025-10-06T03:59:09.001Z","avatar_url":"https://github.com/escherize.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ice\n\nA lightweight terminal color formatting library for Clojure.\n\n\u003cimg src=\"./resources/ice.png\" alt=\"Ice Library Logo\" width=\"200px\"\u003e\n\n## Installation\n\n### deps.edn\n\n``` clojure\n{:deps \n {io.github.escherize/ice {:git/sha \"d55522c8f3dd078499f0eb9869cb2ddcc7e57b29\"}}}\n```\n\n## Usage\n\n``` clojure\n(require '[ice.core :as ice])\n\n;; Basic colored output\n;; p is for printing\n(ice/p [:red \"This text is red\"])\n(ice/p [:on-blue \"This text has blue background\"])\n(ice/p [:bold \"This text is bold\"])\n\n;; Combining colors with nesting\n(ice/p [:red \"This is red \" [:blue \"and this is blue\"]])\n\n;; Complex nested formatting\n(ice/p [:red \"Error: \" [:bold \"Operation failed\"] \" - please try again\"])\n\n;; Creating a color demo\n(apply ice/p (vec \n               (mapcat (fn [color] [color (name color) \" \"]) \n                       (keys #'ice/colors))))\n\n;; Getting colored string without printing (no newline added)\n(def colored-text (ice/p-str [:green \"Success!\"]))\n;; =\u003e Returns colored string without printing and without a trailing newline\n\n;; Disable colors (useful for logging to files)\n(binding [ice/*disable-colors* true]\n  (ice/p [:red \"This will not be colored\"]))\n\n;; Multiple arguments\n(ice/p [:red \"Error: \"] [:bold \"Failed!\"] \" Please try again.\")\n```\n\n## Functions\n\n### `p`\n\nThe `p` function prints colored text to `*out*`, always adding a newline at the end:\n\n``` clojure\n;; Print red text\n(ice/p [:red \"This is red\"])\n\n;; Print nested colors\n(ice/p [:red \"Red\" [:blue \" and blue\"]])\n\n;; Print multiple arguments\n(ice/p [:red \"Error:\"] \" \" [:bold \"Something went wrong\"])\n```\n\n### `p-str`\n\nThe `p-str` function returns a colored string without printing it and without the trailing newline:\n\n```clojure\n;; Get red text as a string\n(def red-text (ice/p-str [:red \"This is red\"]))\n;; =\u003e \"\\033[31mThis is red\\033[0m\"\n\n;; Use in string operations\n(str \"Prefix: \" (ice/p-str [:green \"Success\"]) \" :Suffix\")\n;; =\u003e \"Prefix: \\033[32mSuccess\\033[0m :Suffix\"\n\n;; Useful for logging\n(log/info (ice/p-str [:yellow \"Warning:\"] \" \" [:bold \"Disk space low\"]))\n```\n\nNote: Unlike many other Clojure string functions that add newlines, `p-str` does NOT add a trailing newline, so you can use it with println.\n\n\n\n``` clojure\n(def red-text (ice/p-str [:red \"This is red\"]))\n\n(= \"This is red\" (ice/strip-color red-text))\n;; =\u003e true\n```\n\nAll the color options that can be used as the first element in vectors:\n\n### Text Colors\n- `:red`\n- `:green` \n- `:yellow`\n- `:blue`\n- `:magenta`\n- `:cyan`\n- `:white`\n- `:gray`/`:grey`\n\n### Background Colors\n- `:on-red`\n- `:on-green`\n- `:on-yellow`\n- `:on-blue`\n- `:on-magenta`\n- `:on-cyan`\n- `:on-white`\n- `:on-gray`/`:on-grey`\n\n### Text Formatting\n- `:bold`\n- `:dark`\n- `:underline`\n- `:blink`\n- `:reverse-color`\n- `:concealed`\n\n## License\n\nCopyright © 2025 io.github.escherize\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at:\nhttps://www.eclipse.org/legal/epl-2.0/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescherize%2Fice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fescherize%2Fice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescherize%2Fice/lists"}