{"id":13819888,"url":"https://github.com/piotrmurach/tty-color","last_synced_at":"2025-06-12T13:09:23.220Z","repository":{"id":56558562,"uuid":"48886799","full_name":"piotrmurach/tty-color","owner":"piotrmurach","description":"Terminal color capabilities detection","archived":false,"fork":false,"pushed_at":"2025-04-26T20:09:26.000Z","size":104,"stargazers_count":35,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-07T02:02:21.847Z","etag":null,"topics":["cli","color","ruby-gem","tty","tty-components"],"latest_commit_sha":null,"homepage":"https://ttytoolkit.org","language":"Ruby","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/piotrmurach.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"piotrmurach"}},"created_at":"2016-01-01T19:03:47.000Z","updated_at":"2025-04-26T20:09:29.000Z","dependencies_parsed_at":"2023-12-19T01:26:24.883Z","dependency_job_id":"2659f9b2-dab0-4d27-8d3b-f22fcd2ad6f3","html_url":"https://github.com/piotrmurach/tty-color","commit_stats":{"total_commits":143,"total_committers":5,"mean_commits":28.6,"dds":0.034965034965035,"last_synced_commit":"15eac96ca0f0d59da6c3b86ce67b215d9f354e00"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Ftty-color","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Ftty-color/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Ftty-color/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Ftty-color/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piotrmurach","download_url":"https://codeload.github.com/piotrmurach/tty-color/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Ftty-color/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259265034,"owners_count":22831064,"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":["cli","color","ruby-gem","tty","tty-components"],"created_at":"2024-08-04T08:00:54.520Z","updated_at":"2025-06-12T13:09:23.196Z","avatar_url":"https://github.com/piotrmurach.png","language":"Ruby","funding_links":["https://github.com/sponsors/piotrmurach"],"categories":["Happy Exploring 🤘"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://ttytoolkit.org\"\u003e\u003cimg width=\"130\" src=\"https://github.com/piotrmurach/tty/raw/master/images/tty.png\" alt=\"TTY Toolkit logo\"/\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n# TTY::Color\n\n[![Gem Version](https://badge.fury.io/rb/tty-color.svg)][gem]\n[![Actions CI](https://github.com/piotrmurach/tty-color/actions/workflows/ci.yml/badge.svg)][gh_actions_ci]\n[![Build status](https://ci.appveyor.com/api/projects/status/j1nflklmnfrb2yrf?svg=true)][appveyor]\n[![Code Climate](https://codeclimate.com/github/piotrmurach/tty-color/badges/gpa.svg)][codeclimate]\n[![Coverage Status](https://coveralls.io/repos/github/piotrmurach/tty-color/badge.svg)][coverage]\n\n[gem]: https://badge.fury.io/rb/tty-color\n[gh_actions_ci]: https://github.com/piotrmurach/tty-color/actions/workflows/ci.yml\n[appveyor]: https://ci.appveyor.com/project/piotrmurach/tty-color\n[codeclimate]: https://codeclimate.com/github/piotrmurach/tty-color\n[coverage]: https://coveralls.io/github/piotrmurach/tty-color\n\n\u003e Terminal color capabilities detection.\n\n**TTY::Color** provides independent color support detection component for [TTY](https://github.com/piotrmurach/tty) toolkit.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"tty-color\"\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install tty-color\n\n## Usage\n\n**TTY::Color** allows you to check if terminal supports color:\n\n```ruby\nTTY::Color.color?    # =\u003e true\nTTY::Color.support?  # =\u003e true\n```\n\nYou can also get the number of colors supported by the terminal using `mode` method:\n\n```ruby\nTTY::Color.mode # =\u003e 64\n```\n\nTo detect if color support has been disabled with `NO_COLOR` environment variable, use `disabled?`:\n\n```ruby\nTTY::Color.disabled? # =\u003e false\n```\n\n**TTY::Color** is just a module hence you can include it into your scripts directly:\n\n```ruby\n#!/usr/bin/env ruby\n\ninclude TTY::Color\n\nputs color?\n```\n\n## Command line tool\n\n[tty-color-cli](https://github.com/piotrmurach/tty-color-cli) is a command line tool for the **TTY::Color**.\n\nTo check if terminal supports colors use `-s|--support`:\n\n```bash\ntty-color -s\ntty-color --support\n# =\u003e true\n```\n\nAnd to check color mode use `-m|--mode` option:\n\n```bash\ntty-color -m\ntty-color --mode\n# =\u003e 256\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/piotrmurach/tty-color. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n1. Fork it ( https://github.com/piotrmurach/tty-color/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Code of Conduct\n\nEveryone interacting in the TTY::Color project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/piotrmurach/tty-color/blob/master/CODE_OF_CONDUCT.md).\n\n## Copyright\n\nCopyright (c) 2016 Piotr Murach. See LICENSE for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotrmurach%2Ftty-color","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiotrmurach%2Ftty-color","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotrmurach%2Ftty-color/lists"}