Crayon

Open Source Love Open Source Love PRs Welcome Build Status

Beautiful colored strings right inside your terminal. The Crystal way! :tada:

Installation

Add this to your application's shard.yml:

dependencies:
  crayon:
    github: crystalrealm/crayon

Usage

require "crayon"
cyanOnBlack = Crayon::Crayon.new("light_cyan", "black", {
  "bold" => true,
})

puts cyanOnBlack.apply("Hello from Crayon!")

You have the following color options to choose from for the foreground color:

... and for the background:

API

Crayon simply with uses 1 method. You create a new instance of Crayon::Crayon like so:

instance = Crayon::Crayon.new(@foreground : String, @background : String, *options)

Then, you can apply the colors to any string you wish:

instance.apply("Hello, World!")

Contributing

  1. Fork it (https://github.com/molnarmark/crayon/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