A summary of data about the Ruby ecosystem.

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 9 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.

README.md

colorize Gem Version Ruby Gem Code Climate Test Coverage

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 class
  • require '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

Become Patreon

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


GitHub Events

Total
Last Year

Committers metadata

Last synced: about 15 hours 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 Email 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:


Issue and Pull Request metadata

Last synced: about 2 months 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

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/fazibear/colorize

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

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-01-06T18:05:31.996Z (about 12 hours ago)
  • Versions: 26
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 154,462,715 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-01-04T20:01:58.293Z (2 days ago)
  • Versions: 26
  • Dependent Packages: 2,234
  • Dependent Repositories: 31,647
  • Downloads: 154,355,971 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-01-04T20:02:00.579Z (2 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%

Dependencies

colorize.gemspec rubygems
  • codeclimate-test-reporter ~> 0.4 development
  • json ~> 1.0 development
  • minitest ~> 5.0 development
  • rake ~> 10.0 development
.github/workflows/colorize.yml.tmp actions
  • actions/checkout v3 composite
  • google-github-actions/release-please-action v3 composite
  • ruby/setup-ruby v1 composite
.github/workflows/release.yml actions
  • actions/checkout v3 composite
  • google-github-actions/release-please-action v3 composite
  • ruby/setup-ruby v1 composite
.github/workflows/test.yml actions
  • actions/checkout v3 composite
  • ruby/setup-ruby v1 composite
Gemfile rubygems
  • 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.981273512318612