package

github.com/GalactHD/gradientty

1.1.0 / published Oct 16, 2025 / repository

A Simple, customizable and lightweight gradient text to console.

Gradientty logo

GitHub release

A simple, customizable, and lightweight gradient text library for the console, inspired by gradient-string.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      gradientty:
        github: galacthd/gradientty
  2. Run shards install

Usage

require "gradientty"

# Some colors are based on gradient-string, a typescript/javascript library.

# Minimalist gradient based on Crystal Language.
puts Gradientty.crystal("Hello Crystal!")

# Classic rainbow gradient.
puts Gradientty.rainbow("Hello Rainbow!")

# Soft pastel gradient
puts Gradientty.pastel("Hello Pastel!")

# Vice-style gradient
puts Gradientty.vice("Hello Vice!")

# Custom gradient: any colors you want
custom = Gradientty.gradient(["#ff69b4", "#8a2be2", "#1e90ff"])
puts custom.multiline("Hello\nCustom Gradient!", true) # continuous across lines

License

MIT © GalactHD

API