Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ombre

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ombre

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Ruby Ombre

Ombre provides gradients for your terminal between any number of RGB values.

Features

  • Horizontal, vertical, and diagonal gradients for any number of colors.

True Color Support

This will only look good on terminals that support 24bit colors, for now.

Setup

Add to Gemfile:

gem 'ombre'

and run bundle install.

In Ruby do:

require 'ombre'

Usage

There are four main functions available for Ombre:

# colors in the below functions should be an array of 24 bit hexidecimal RGB values as strings.

# Returns the block of text marked up with colors to create a horizontal gradient from left to right
Ombre.horizontal(text, colors)
Ombre.horizontal("############\n#          #\n# Horiz. ###\n# Ombre ####\n# Test #####\n# From #####\n# Red ######\n# To #######\n# Blue #####\n#          #\n############", ["FF0000", "0000FF"])

# Returns the block of text marked up with colors to create a vertical gradient from top to bottom
Ombre.vertical(text, colors)
Ombre.vertical("############\n#          #\n# Vertical #\n# Ombre ####\n# Test #####\n# From #####\n# Red ######\n# To #######\n# Blue #####\n#          #\n############", ["FF0000", "0000FF"])

# Returns the block of text marked up with colors to create a diagonal gradient from top-left to bottom-right
Ombre.diagonal(text, colors)
Ombre.diagonal("############\n#          #\n# Diagonal #\n# Ombre ####\n# Test #####\n# From #####\n# Red ######\n# To #######\n# Blue #####\n#          #\n############", ["FF0000", "0000FF"])

# Returns the block of text marked up with colors to create a diagonal gradient from bottom-left to top-right
Ombre.diagonal_up(text, colors)
Ombre.diagonal_up("############\n#          #\n# Diagonal #\n# Ombre ####\n# Test #####\n# From #####\n# Red ######\n# To #######\n# Blue #####\n#          #\n############", ["FF0000", "0000FF"])

Copyright (c) 2022 Justin Paulson, released under the MIT license.

FAQs

Package last updated on 25 Apr 2022

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc