{"id":21261511,"url":"https://github.com/chenasraf/terminal_color_parser_dart","last_synced_at":"2026-02-21T19:05:31.443Z","repository":{"id":232373352,"uuid":"784178012","full_name":"chenasraf/terminal_color_parser_dart","owner":"chenasraf","description":"Parse terminal colors for displaying in other formats. Supports ANSI and xterm256.","archived":false,"fork":false,"pushed_at":"2025-01-10T23:12:41.000Z","size":35,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-17T13:47:22.034Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/terminal_color_parser","language":"Dart","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/chenasraf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":"chenasraf","patreon":null,"open_collective":null,"ko_fi":"casraf","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=TSH3C3ABGQM22\u0026currency_code=ILS\u0026source=url"]}},"created_at":"2024-04-09T10:42:19.000Z","updated_at":"2025-01-10T23:10:14.000Z","dependencies_parsed_at":"2024-04-09T14:23:07.715Z","dependency_job_id":"879293bc-81f0-42ab-97a2-4880de6ef6e6","html_url":"https://github.com/chenasraf/terminal_color_parser_dart","commit_stats":null,"previous_names":["chenasraf/terminal_color_parser_dart"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/chenasraf/terminal_color_parser_dart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fterminal_color_parser_dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fterminal_color_parser_dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fterminal_color_parser_dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fterminal_color_parser_dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenasraf","download_url":"https://codeload.github.com/chenasraf/terminal_color_parser_dart/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fterminal_color_parser_dart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29690678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T18:18:25.093Z","status":"ssl_error","status_checked_at":"2026-02-21T18:18:22.435Z","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":[],"created_at":"2024-11-21T04:43:37.768Z","updated_at":"2026-02-21T19:05:31.428Z","avatar_url":"https://github.com/chenasraf.png","language":"Dart","funding_links":["https://github.com/sponsors/chenasraf","https://ko-fi.com/casraf","https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=TSH3C3ABGQM22\u0026currency_code=ILS\u0026source=url","https://ko-fi.com/casraf'"],"categories":[],"sub_categories":[],"readme":"# Terminal Color Parser\n\nThis package is an ANSI/xterm256 color parser. You can get the list of colored segments by creating\na `ColorParser` instance and calling `parse()` method.\n\n```dart\nimport 'package:terminal_color_parser/terminal_color_parser.dart';\n\nfinal coloredText = ColorParser('Hello, \\x1B[32mworld\\x1B[0m!').parse();\n\nvar i = 0;\nfor (final token in coloredText) {\n  print('Token #$i: ${token.formatted}');\n  print('  - Text: ${token.text}');\n  print('  - Foreground: ${token.fgColor}');\n  print('  - Background: ${token.bgColor}');\n  print('  - Bold: ${token.bold}');\n  print('  - Italic: ${token.italic}');\n  print('  - Underline: ${token.underline}');\n  print('  - Styles: ${token.styles}');\n  i++;\n}\n```\n\nYou can also re-format the ANSI codes by using the `formatted` property on each token.\n\n```dart\nfinal tokens = [\n  ColorToken(text: 'Hello, '),\n  ColorToken(\n    text: 'world',\n    fgColor: ANSIColor.fg(32), // Can also use RGBColor.fg(r, g, b)\n    bgColor: Color.none,\n    styles: {StyleByte.underline},\n  ),\n  ColorToken(text: '!'),\n];\n\nvar i = 0;\nfor (final token in coloredText) {\n  print('Token #$i: ${token.formatted}');\n  print('  - Text: ${token.text}');\n  print('  - Foreground: ${token.fgColor.formatted}');\n  print('  - Background: ${token.bgColor.formatted}');\n  print('  - Bold: ${token.bold}');\n  print('  - Italic: ${token.italic}');\n  print('  - Underline: ${token.underline}');\n  print('  - Styles: ${token.styles}');\n  i++;\n}\n```\n\n## Contributing\n\nI am developing this package on my free time, so any support, whether code, issues, or just stars is\nvery helpful to sustaining its life. If you are feeling incredibly generous and would like to donate\njust a small amount to help sustain this project, I would be very very thankful!\n\n\u003ca href='https://ko-fi.com/casraf' target='_blank'\u003e\n  \u003cimg height='36' style='border:0px;height:36px;'\n    src='https://cdn.ko-fi.com/cdn/kofi1.png?v=3'\n    alt='Buy Me a Coffee at ko-fi.com' /\u003e\n\u003c/a\u003e\n\nI welcome any issues or pull requests on GitHub. If you find a bug, or would like a new feature,\ndon't hesitate to open an appropriate issue and I will do my best to reply promptly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenasraf%2Fterminal_color_parser_dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenasraf%2Fterminal_color_parser_dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenasraf%2Fterminal_color_parser_dart/lists"}