https://github.com/fazibear/colorize
Ruby string class extension. It add some methods to set color, background color and text effect on console easier using ANSI escape sequences.
https://github.com/fazibear/colorize
Keywords
ansi-escape-sequences gem ruby
Keywords from Contributors
rubygem activerecord
Last synced: about 12 hours ago
JSON representation
Repository metadata
Ruby string class extension. It add some methods to set color, background color and text effect on console easier using ANSI escape sequences.
- Host: GitHub
- URL: https://github.com/fazibear/colorize
- Owner: fazibear
- License: gpl-2.0
- Created: 2009-11-23T11:45:34.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2024-05-21T23:51:26.000Z (almost 2 years ago)
- Last Synced: 2026-02-05T11:44:20.079Z (26 days ago)
- Topics: ansi-escape-sequences, gem, ruby
- Language: Ruby
- Homepage: http://rdoc.info/projects/fazibear/colorize
- Size: 202 KB
- Stars: 1,283
- Watchers: 17
- Forks: 141
- Open Issues: 5
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
README.md
colorize

Ruby gem for colorizing text using ANSI escape sequences.
Extends String class or add a ColorizedString with methods to set the text color, background color and text effects.
modes
require 'colorize'- Extends String classrequire 'colorized_string'- add ColorizedString class
features
- change string color
- change string background
- change string effect
- chain methods
- display color samples
- disable colorization
- prevent colors
usage
require 'colorize'
String.colors # return array of all possible colors names
String.modes # return array of all possible modes
String.color_samples # displays color samples in all combinations
String.disable_colorization # check if colorization is disabled
# disable colorization (false by default)
String.disable_colorization = false # enable colorization
String.disable_colorization false # enable colorization
String.disable_colorization = true # disable colorization
String.disable_colorization true # disable colorization
# prevent colors (false by default)
String.prevent_colors = false # override current string colors
String.prevent_colors false # override current string colors
String.prevent_colors = true # don't colorize colorized strings
String.prevent_colors true # don't colorize colorized strings
# adding aliases (:gray and :grey added by default)
String.add_color_alias(:niebieski, :blue)
String.add_color_alias(:zielony => :green)
String.add_color_alias(czarny: :black)
String.add_color_alias(czerwony: :red, granatowy: :blue)
# examaples
puts "This is blue".colorize(:blue)
puts "This is light blue".colorize(:light_blue)
puts "This is also blue".colorize(:color => :blue)
puts "This is bold green".colorize(:color => :green, :mode => :bold)
puts "This is light blue with red background".colorize(:color => :light_blue, :background => :red)
puts "This is light blue with red background".colorize(:light_blue ).colorize( :background => :red)
puts "This is blue text on red".blue.on_red
puts "This is red on blue".colorize(:red).on_blue
puts "This is red on blue and underline".colorize(:red).on_blue.underline
puts "This is blinking blue text on red".blue.on_red.blink
puts "This is uncolorized".blue.on_red.uncolorize
require 'colorized_string'
ColorizedString.colors # return array of all possible colors names
ColorizedString.modes # return array of all possible modes
ColorizedString.color_samples # displays color samples in all combinations
ColorizedString.disable_colorization # check if colorization is disabled
# disable colorization (false by default)
ColorizedString.disable_colorization = false # enable colorization
ColorizedString.disable_colorization false # enable colorization
ColorizedString.disable_colorization = true # disable colorization
ColorizedString.disable_colorization true # disable colorization
# prevent colors (false by default)
ColorizedString.prevent_colors = false # override current string colors
ColorizedString.prevent_colors false # override current string colors
ColorizedString.prevent_colors = true # don't colorize colorized strings
ColorizedString.prevent_colors true # don't colorize colorized strings
# adding aliases (:gray and :grey added by default)
ColorizedString.add_color_alias(:niebieski, :blue)
ColorizedString.add_color_alias(:zielony => :green)
ColorizedString.add_color_alias(czarny: :black)
ColorizedString.add_color_alias(czerwony: :red, granatowy: :blue)
# examples
puts ColorizedString["This is blue"].colorize(:blue)
puts ColorizedString["This is light blue"].colorize(:light_blue)
puts ColorizedString["This is also blue"].colorize(:color => :blue)
puts ColorizedString["This is bold green"].colorize(:color => :green, :mode => :bold)
puts ColorizedString["This is light blue with red background"].colorize(:color => :light_blue, :background => :red)
puts ColorizedString["This is light blue with red background"].colorize(:light_blue ).colorize( :background => :red)
puts ColorizedString["This is blue text on red"].blue.on_red
puts ColorizedString["This is red on blue"].colorize(:red).on_blue
puts ColorizedString["This is red on blue and underline"].colorize(:red).on_blue.underline
puts ColorizedString["This is blinking blue text on red"].blue.on_red.blink
puts ColorizedString["This is uncolorized"].blue.on_red.uncolorize
puts ColorizedString.new("This is blue").blue
puts ColorizedString.new("This is light blue").colorize(:light_blue)
requirements
- Win32/Console/ANSI (for Windows)
install
- gem install colorize
Note: You may need to use sudo to install gems
thank you
license
Copyright (C) 2007-2024 Michał Kalbarczyk
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Owner metadata
- Name: Michał Kalbarczyk
- Login: fazibear
- Email:
- Kind: user
- Description:
- Website: https://fazibear.me
- Location:
- Twitter: fazibear
- Company:
- Icon url: https://avatars.githubusercontent.com/u/687?u=4f39825b346b6aa764f8fd9a77c6b925d4f949f7&v=4
- Repositories: 194
- Last ynced at: 2025-12-26T02:42:11.364Z
- Profile URL: https://github.com/fazibear
GitHub Events
Total
- Pull request event: 1
- Fork event: 1
- Issues event: 1
- Watch event: 38
Last Year
- Issues event: 1
- Watch event: 20
Committers metadata
Last synced: 1 day ago
Total Commits: 214
Total Committers: 16
Avg Commits per committer: 13.375
Development Distribution Score (DDS): 0.159
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Michał Kalbarczyk | f****r@g****m | 180 |
| jefflunt | j****t@g****m | 10 |
| github-actions[bot] | 4****] | 9 |
| Satya | g****b@t****m | 2 |
| Adrien THÉBAULT | me@a****r | 2 |
| niko-pax-uofa | a****0@a****u | 1 |
| namusyaka | n****a@g****m | 1 |
| Vassilis Rizopoulos | v****s@g****m | 1 |
| Jose Diaz-Gonzalez | e****l@j****m | 1 |
| Fredrik Forsmo | f****e | 1 |
| Brian Jubelirer | b****6@g****m | 1 |
| Anton Dieterle | a****e@g****m | 1 |
| Alexander Stanko | a****o@a****u | 1 |
| Alexander Ivanov | a****2@g****m | 1 |
| AJ Acevedo | aj@a****m | 1 |
| garretblankenship | g****p@c****u | 1 |
Committer domains:
- coderacademy.edu.au: 1
- ajalabs.com: 1
- aviasales.ru: 1
- josediazgonzalez.com: 1
- adelaide.edu.au: 1
- adrien-thebault.fr: 1
- thesatya.com: 1
Issue and Pull Request metadata
Last synced: 8 days ago
Total issues: 45
Total pull requests: 58
Average time to close issues: 11 months
Average time to close pull requests: 5 months
Total issue authors: 43
Total pull request authors: 30
Average comments per issue: 3.0
Average comments per pull request: 0.9
Merged pull request: 38
Bot issues: 0
Bot pull requests: 12
Past year issues: 1
Past year pull requests: 2
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 1
Past year pull request authors: 1
Past year average comments per issue: 0.0
Past year average comments per pull request: 0.0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- cliffom (2)
- avnerbarr (2)
- vishnun (1)
- Paxa (1)
- dimoon (1)
- xob (1)
- ydaniju (1)
- mslinn (1)
- gaultier (1)
- dwinings (1)
- hggh (1)
- noam87 (1)
- mattl (1)
- glinot (1)
- coolo (1)
Top Pull Request Authors
- fazibear (15)
- github-actions[bot] (12)
- ruben-sa-brito (2)
- jefflunt (2)
- andrew (2)
- jacknoble (1)
- akuhn (1)
- phoet (1)
- TheStranjer (1)
- bjubes (1)
- moretea (1)
- joshk (1)
- Wardrop (1)
- kmasa (1)
- yatish27 (1)
Top Issue Labels
Top Pull Request Labels
- autorelease: tagged (9)
- autorelease: pending (3)
Package metadata
- Total packages: 13
-
Total downloads:
- rubygems: 313,784,746 total
- Total docker downloads: 200,877,522
- Total dependent packages: 2,234 (may contain duplicates)
- Total dependent repositories: 31,647 (may contain duplicates)
- Total versions: 74
- Total maintainers: 1
gem.coop: colorize
Extends String class or add a ColorizedString with methods to set text color, background color and text effects.
- Homepage: http://github.com/fazibear/colorize
- Documentation: http://www.rubydoc.info/gems/colorize/
- Licenses: GPL-2.0
- Latest release: 1.1.0 (published over 2 years ago)
- Last Synced: 2026-02-28T15:00:53.178Z (3 days ago)
- Versions: 26
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 156,890,475 Total
- Docker Downloads: 100,438,761
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Downloads: 0.158%
- Average: 0.175%
- Docker downloads count: 0.543%
- Maintainers (1)
rubygems.org: colorize
Extends String class or add a ColorizedString with methods to set text color, background color and text effects.
- Homepage: http://github.com/fazibear/colorize
- Documentation: http://www.rubydoc.info/gems/colorize/
- Licenses: GPL-2.0
- Latest release: 1.1.0 (published over 2 years ago)
- Last Synced: 2026-02-28T23:31:31.931Z (2 days ago)
- Versions: 26
- Dependent Packages: 2,234
- Dependent Repositories: 31,647
- Downloads: 156,894,271 Total
- Docker Downloads: 100,438,761
-
Rankings:
- Dependent packages count: 0.024%
- Downloads: 0.139%
- Dependent repos count: 0.193%
- Docker downloads count: 0.651%
- Average: 0.818%
- Stargazers count: 1.734%
- Forks count: 2.164%
- Maintainers (1)
proxy.golang.org: github.com/fazibear/colorize
- Homepage:
- Documentation: https://pkg.go.dev/github.com/fazibear/colorize#section-documentation
- Licenses: gpl-2.0
- Latest release: v1.0.4 (published over 2 years ago)
- Last Synced: 2026-02-28T03:47:41.553Z (3 days ago)
- Versions: 12
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Stargazers count: 1.894%
- Forks count: 2.243%
- Average: 5.739%
- Dependent packages count: 8.439%
- Dependent repos count: 10.381%
debian-10: ruby-colorize
- Homepage: https://github.com/fazibear/colorize
- Documentation: https://packages.debian.org/buster/ruby-colorize
- Licenses: gpl-2.0
- Latest release: 0.8.1-1 (published 20 days ago)
- Last Synced: 2026-02-13T04:19:57.821Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.10: ruby-colorize
- Homepage: https://github.com/fazibear/colorize
- Licenses: gpl-2.0
- Latest release: 0.8.1-1.1 (published 18 days ago)
- Last Synced: 2026-02-13T18:16:49.682Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-20.04: ruby-colorize
- Homepage: https://github.com/fazibear/colorize
- Licenses: gpl-2.0
- Latest release: 0.8.1-1 (published 18 days ago)
- Last Synced: 2026-02-13T07:11:33.710Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-colorize
- Homepage: https://github.com/fazibear/colorize
- Documentation: https://packages.debian.org/bullseye/ruby-colorize
- Licenses: gpl-2.0
- Latest release: 0.8.1-1 (published 20 days ago)
- Last Synced: 2026-02-13T08:19:11.057Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.04: ruby-colorize
- Homepage: https://github.com/fazibear/colorize
- Licenses: gpl-2.0
- Latest release: 0.8.1-1.1 (published 20 days ago)
- Last Synced: 2026-02-11T06:37:08.119Z (20 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-colorize
- Homepage: https://github.com/fazibear/colorize
- Documentation: https://packages.debian.org/bookworm/ruby-colorize
- Licenses:
- Latest release: 0.8.1-1.1 (published 18 days ago)
- Last Synced: 2026-02-12T23:27:24.028Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-24.04: ruby-colorize
- Homepage: https://github.com/fazibear/colorize
- Licenses: gpl-2.0
- Latest release: 0.8.1-1.1 (published 18 days ago)
- Last Synced: 2026-02-13T01:01:47.065Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-13: ruby-colorize
- Homepage: https://github.com/fazibear/colorize
- Documentation: https://packages.debian.org/trixie/ruby-colorize
- Licenses:
- Latest release: 0.8.1-1.1 (published 19 days ago)
- Last Synced: 2026-02-13T13:14:22.950Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Dependencies
- codeclimate-test-reporter ~> 0.4 development
- json ~> 1.0 development
- minitest ~> 5.0 development
- rake ~> 10.0 development
- actions/checkout v3 composite
- google-github-actions/release-please-action v3 composite
- ruby/setup-ruby v1 composite
- actions/checkout v3 composite
- google-github-actions/release-please-action v3 composite
- ruby/setup-ruby v1 composite
- actions/checkout v3 composite
- ruby/setup-ruby v1 composite
- json ~> 2.0 development
- minitest ~> 5.0 development
- rake ~> 13.0 development
- rubocop ~> 1.0 development
- rubocop-github ~> 0.20 development
- rubocop-minitest ~> 0.29.0 development
- rubocop-performance ~> 1.16 development
- rubocop-rake ~> 0.6 development
Score: 29.992522880974285
