module

Lolcat

The Lolcat module provides methods to colorize text with rainbow colors.

This module serves as the main entry point for using lolcat as a library. It provides simplified methods for adding rainbow colors to text from files or strings.

Constants

REPOSITORY = shard_value("repository")
VERSION = shard_value("version")

Class methods

cat(path : Path, spread : Float64 = 3.0, freq : Float64 = 0.1, offset : Float64 | Nil = nil, invert : Bool = false, force : Bool = false) : Nil

Print a file with rainbow colors

  • If offset is not provided, it will be random.
  • If force is true, it will force color output even if stdout is not a TTY.
Source
cat(input : String, spread : Float64 = 3.0, freq : Float64 = 0.1, offset : Float64 | Nil = nil, invert : Bool = false, force : Bool = false) : Nil

Print a string with rainbow colors

  • If offset is not provided, it will be random.
  • If force is true, it will force color output even if stdout is not a TTY.
Source
lol(input, spread : Float64 = 3.0, freq : Float64 = 0.1, offset : Float64 | Nil = nil, invert : Bool = false, &) : Nil

Get a rainbow string line by line

  • If offset is not provided, it will be random.

Example:

Lolcat.lol("Rainbow string", invert: true) do |line|
  print line
end
Source

Macros

shard_value(key)
Source

Nested types