color

Terminal color capabilities detection
term logo

Term::Color

spec status

Terminal color capabilities detection.

Term::Color provides an independent color support detection component for crystal-term.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      term-color:
        github: crystal-term/color
    
  2. Run shards install

Usage

require "term-color"

Term::Screen allows you to check if your terminal supports color:

Term::Color.support?  # => true

You can also get the number of colors supported by the terminal:

Term::Color.mode      # => 64

Term::Color is just a module so you can easily include it into your own scripts:

require "term-color"

include Term::Color

puts support?

Contributing

  1. Fork it (https://github.com/crystal-term/color/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

color

Owner
Statistic
  • 4
  • 1
  • 0
  • 0
  • 0
  • almost 2 years ago
  • May 7, 2020
License

MIT License

Links
Synced at

Sun, 24 Nov 2024 01:28:31 GMT

Languages