term-color

Terminal color capabilities detection
0.2.0 released
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

term-color:
  github: crystal-term/color
  version: ~> 0.2.0
License MIT
Crystal >= 1.0.0

Authors

Dependencies 0

Development Dependencies 1

  • spectator ~> 0.12.0
    {'gitlab' => 'arctic-fox/spectator', 'version' => '~> 0.12.0'}

Dependents 1

Last synced .
search fire star recently