2 releases (1 stable)

Uses new Rust 2024

new 1.0.0 Apr 15, 2025

#22 in #ansi-colors

Download history 141/week @ 2025-04-10

141 downloads per month
Used in lynxfetch

GPL-3.0-or-later

30KB
194 lines

inkline

Overview

Display colorized ascii art to the terminal

How to use

To use this crate, add it as a dependency in your Cargo.toml:

[dependencies]
inkline = "1.0.0"

Example code:

use tintify::DynColors;
use tintify::AnsiColors;

fn main() -> () {
    const ASCII: &str = r#"
{2}            .:--::////::--.`
{1}        `/yNMMNho{2}////////////:.
{1}      `+NMMMMMMMMmy{2}/////////////:`
{0}    `-:::{1}ohNMMMMMMMNy{2}/////////////:`
{0}   .::::::::{1}odMMMMMMMNy{2}/////////////-
{0}  -:::::::::::{1}/hMMMMMMMmo{2}////////////-
{0} .::::::::::::::{1}oMMMMMMMMh{2}////////////-
{0}`:::::::::::::{1}/dMMMMMMMMMMNo{2}///////////`
{0}-::::::::::::{1}sMMMMMMmMMMMMMMy{2}//////////-
{0}-::::::::::{1}/dMMMMMMs{0}:{1}+NMMMMMMd{2}/////////:
{0}-:::::::::{1}+NMMMMMm/{0}:::{1}/dMMMMMMm+{2}///////:
{0}-::::::::{1}sMMMMMMh{0}:::::::{1}dMMMMMMm+{2}//////-
{0}`:::::::{1}sMMMMMMy{0}:::::::::{1}dMMMMMMm+{2}/////`
{0} .:::::{1}sMMMMMMs{0}:::::::::::{1}mMMMMMMd{2}////-
{0}  -:::{1}sMMMMMMy{0}::::::::::::{1}/NMMMMMMh{2}//-
{0}   .:{1}+MMMMMMd{0}::::::::::::::{1}oMMMMMMMo{2}-
{1}    `yMMMMMN/{0}:::::::::::::::{1}hMMMMMh.
{1}      -yMMMo{0}::::::::::::::::{1}/MMMy-
{1}        `/s{0}::::::::::::::::::{1}o/`
{0}            ``.---::::---..`
"#;

    let colors: Vec<DynColors> = vec![
        DynColors::Ansi(AnsiColors::BrightCyan),
        DynColors::Ansi(AnsiColors::BrightBlue),
        DynColors::Ansi(AnsiColors::BrightMagenta)
    ];

    let art: AsciiArt = AsciiArt::new(ASCII, colors.as_slice(), true);

    for line in art {
        println!("{}", line);
    }
}

Result

screenshot

Dependencies

~145KB