{"id":15529963,"url":"https://github.com/snsvrno/ansi-hx","last_synced_at":"2026-02-09T07:04:48.655Z","repository":{"id":137809494,"uuid":"496375844","full_name":"snsvrno/ansi-hx","owner":"snsvrno","description":"easy to use ansi commands to make beautiful and interesting terminal appications in haxe","archived":false,"fork":false,"pushed_at":"2023-09-07T22:35:14.000Z","size":45,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-17T05:32:01.407Z","etag":null,"topics":["ansi","haxe","library","terminal","tui"],"latest_commit_sha":null,"homepage":"","language":"Haxe","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/snsvrno.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":"2022-05-25T20:11:29.000Z","updated_at":"2022-10-31T17:12:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"9cf1e0a4-ca5a-4fb1-a90b-65cf575290fb","html_url":"https://github.com/snsvrno/ansi-hx","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/snsvrno/ansi-hx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snsvrno%2Fansi-hx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snsvrno%2Fansi-hx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snsvrno%2Fansi-hx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snsvrno%2Fansi-hx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snsvrno","download_url":"https://codeload.github.com/snsvrno/ansi-hx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snsvrno%2Fansi-hx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29258626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["ansi","haxe","library","terminal","tui"],"created_at":"2024-10-02T11:20:37.969Z","updated_at":"2026-02-09T07:04:47.709Z","avatar_url":"https://github.com/snsvrno.png","language":"Haxe","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ANSI.hx\n\nA haxe library with easy access to ANSI commands / escape codes.\n\nImplements most commands allowing for complete control of the terminal.\n\n## Getting Started\n\ninstall using this git repo\n\n```\nhaxelib git http://www.github.com/snsvrno/ansi-hx.git\n```\n\nand then use to make rich terminal applications\n\n```haxe\nimport ansi.Paint.*;\n// you can use single commands it change different aspects\n\nSys.println(background(Cyan) + bold() + \" [ ANSI.hx ] \" + reset());\nSys.println(color(Magenta) + \"It's \" + italic() + color() + \"Great!\" + italic(false));\n\n// or you can use the paint wrapper\n\nSys.println(paint(\" [ ANSI.hx ] \", null, Cyan, Bold));\nSys.println(paint(\"It's \", Magenta) + paint(\"Great!\", Standout));\n```\n\n![output of the above commands](images/short-example.png)\n\n## General Usage\n\nThere are two main packages:\n\n1. `ansi.Command` - sends commands to the terminal\n2. `ansi.Paint` - creates command strings that need to be written to the terminal\n\n### Features\n\n#### Color Fallback\n\nBy default **ANSI.hx** will be using `True Color` mode. This should allow you to print to the terminal using all 24bits of colors.\n\nAll though all modern terminals _should_ support this, there maybe some that do not. **ANSI.hx** has a fallback so that things will look somewhat like you want them.\n\nIn order to enable fallback you need to run the color mode check function\n\n```haxe\nansi.colors.ColorMode.check();\n```\n\nThis will determine if the terminal supports `True Color` `256 Color` or just the standard `16` colors.\n\nEverything else will automatically evaluate based on what the terminal supports.\n\n```haxe\nSys.println(backgroundRGB(0, 230, 0));\n```\n\nThis will show the actual rgb color of (0,230,0) if `True Color`, the closest 256 color of index `46` (0,255,0) in `256 Color` or the standard color of `Green`.\n\n![3 different outputs based on the color mode of terminal](images/color-fallback.png)\n\nIt is imporant to note that the standard color scheme may vary drastically from the desired color because of a user's terminal theme.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnsvrno%2Fansi-hx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnsvrno%2Fansi-hx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnsvrno%2Fansi-hx/lists"}