Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mazznoer/lolcrab
Like lolcat but with noise and more colorful.
https://github.com/mazznoer/lolcrab
cli lolcat rainbow
Last synced: about 1 month ago
JSON representation
Like lolcat but with noise and more colorful.
- Host: GitHub
- URL: https://github.com/mazznoer/lolcrab
- Owner: mazznoer
- License: mit
- Created: 2021-05-23T14:18:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-20T10:54:22.000Z (3 months ago)
- Last Synced: 2024-10-13T01:13:08.415Z (2 months ago)
- Topics: cli, lolcat, rainbow
- Language: Rust
- Homepage:
- Size: 573 KB
- Stars: 111
- Watchers: 5
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-linux-ricing - lolcrab - Like lolcat but with noise and more colorful. (Terminal / Fancies)
README
# `lolcrab` :crab:
> make your life more colorful, still boring but more colorful
[![Build Status](https://github.com/mazznoer/lolcrab/actions/workflows/ci.yml/badge.svg)](https://github.com/mazznoer/lolcrab/actions)
[![crates.io](https://img.shields.io/crates/v/lolcrab.svg)](https://crates.io/crates/lolcrab)
[![docs.rs](https://docs.rs/lolcrab/badge.svg)](https://docs.rs/lolcrab)Like [`lolcat`](https://github.com/busyloop/lolcat) but with [noise](https://en.wikipedia.org/wiki/OpenSimplex_noise) and more colorful. This is a fork of [`lcat`](https://github.com/davidkna/lcat-rs).
![lolcrab](docs/images/lolcrab.png)
## Installation
Pre-compiled binaries for Linux, macOS and Windows is avaliable on [release page](https://github.com/mazznoer/lolcrab/releases).
### Cargo
`lolcrab` can be installed using [cargo](https://www.rust-lang.org/tools/install).
```shell
cargo install lolcrab
```## Usage
```text
Usage: lolcrab [OPTIONS] [File]...Arguments:
[File]... Files to read [default: -]Options:
-g, --gradient Sets color gradient [default: rainbow] [possible values: cividis, cool, cubehelix,
fruits, inferno, magma, plasma, rainbow, rd-yl-gn, sinebow, spectral, turbo,
viridis, warm]
--presets Show all preset gradients
-c, --custom Custom gradient in CSS gradient format
--sharp Sharp gradient
-s, --scale Sets noise scale. Try value between 0.01 .. 0.2 [default: 0.034]
-S, --seed Sets seed [default: random]
-i, --invert Colorize the background
-r, --random-colors Use random colors as custom gradient [1 .. 100]
-a, --animate Enable animation mode
-d, --duration Animation duration
--speed Animation speed
-h, --help Print help
-V, --version Print version
```## Using `lolcrab` as a Library
Add this to your Cargo.toml
```toml
lolcrab = { version = "0.4", default-features = "false" }
```### Example
```rust
use lolcrab::Lolcrab;
use std::io;const TEXT: &str = "\
•••••••••••••••••••••••••••••••••••••••••••
••442463299144744830108724702438783348716••
••665891426009540978622724448305819269356••
••078289454141226451790882961903610719673••
••56505384476•••••••••••••••••39761609699••
••47928752907•• { lolcrab } ••33810561851••
••51609982385•••••••••••••••••43459368213••
••980457234663167653959566555465520046709••
••677103598707232478714861999441705454744••
••012721882924436718718457599087686681354••
•••••••••••••••••••••••••••••••••••••••••••
";fn main() -> Result<(), Box> {
let stdout = io::stdout();
let mut stdout = stdout.lock();// Initialize Lolcrab using default gradient and default noise
let mut lol = Lolcrab::new(None, None);lol.colorize_str(TEXT, &mut stdout)?;
lol.set_invert(true);
lol.randomize_position();
lol.colorize_str(TEXT, &mut stdout)?;lol.set_invert(false);
lol.reset_position();
lol.colorize_str(TEXT, &mut stdout)?;Ok(())
}
```