crolorama
Version, currently main branch1 version
- main branchlatestMay 22, 2023
github.com/simplylu/crolorama
Crystal shard for colored text in the Terminal
Installation
# Add this to your shard.yml
dependencies:
crolorama:
github: simplylu/crolorama
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.3.2- License
- MIT
- Author
- simplylu @s1mplylu
Dependencies
This version declares no dependencies.
README
crolorama
Easy text coloring and styling in Crystal. Currently only support for systems with ANSI support.
Tested only on Linux.
Installation
-
Add the dependency to your
shard.yml:dependencies: crolorama: github: simplylu/crolorama -
Run
shards install
Usage
require "crolorama"
crol = Crolorama::Color.new
puts "This is #{crol.fg("red")}RED#{crol.reset}"
Available methods
- Change foreground color:
crol.fg - Change background color:
crol.bg - Change text style:
crol.style - Reset colors:
crol.reset - Reset all (including styles):
crol.reset_all
Experimental
- Move cursor n lines up:
crol.up n - Move cursor n lines down:
crol.down n - Move cursor n lines forward:
crol.forward n - Move cursor n lines back:
crol.back n - Position cursor at x across, y down:
crol.pos x, y
Example: crystal run src/example.cr
Available colors: crystal run src/colors.cr

Development
This shard is mainly oriented towards the colorama module of python. In case you wanna add new features, see Contributing.
Contributing
- Fork it (https://github.com/simplylu/crolorama/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
- simplylu - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- May 22, 2023
- Crystal
1.3.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/simplylu/crolorama
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1