Socket
Book a DemoInstallSign in
Socket

unicolor

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unicolor

1.0.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

unicolor

Colorize an object uniquely!

Install

$ gem install unicolor

Usage

Call Object#unicolor:

> require 'unicolor'
> "foo".unicolor
 => "\e[31mfoo\e[0m"

Object#uc as alias:

> "foo".uc
 => "\e[31mfoo\e[0m"

Change the theme

> Unicolor.theme :bg
> "foo".uc
 => "\e[41mfoo\e[0m"

Define a theme

> Unicolor.define_theme :my_theme, (31..36).to_a

Standard themes

Unicolor.define_theme :fg, (31..36).to_a + (91..96).to_a
Unicolor.define_theme :bg, (41..46).to_a + (101..106).to_a
Unicolor.define_theme :fg256, (1..255).map{|i| [38, 5, i]}
Unicolor.define_theme :bg256, (1..255).map{|i| [48, 5, i]}

Copyright (c) 2011 jugyo. See LICENSE.txt for further details.

FAQs

Package last updated on 11 Nov 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.