Term::Color
Terminal color capabilities detection.
Term::Color provides an independent color support detection component for crystal-term.
Installation
-
Add the dependency to your
shard.yml
:dependencies: term-color: github: crystal-term/color
-
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
- Fork it (https://github.com/crystal-term/color/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Chris Watson - creator and maintainer