tinted-scheme-extractor

Crates.iotinted-scheme-extractor
lib.rstinted-scheme-extractor
version0.5.0
sourcesrc
created_at2024-06-16 12:19:01.425875
updated_at2024-10-05 22:03:05.011432
descriptionA tool to create a Tinted Theming scheme based on a provided image
homepagehttps://github.com/tinted-theming/tinted-scheme-extractor-rs
repositoryhttps://github.com/tinted-theming/tinted-scheme-extractor-rs
max_upload_size
id1273489
size328,358
(tinted-theming-bot)

documentation

README

Tinted Scheme Extractor

Matrix Chat Crates.io LICENSE

tinted-scheme-extractor is a Tinted Theming Rust library which generates a Base16 theme based a provided image.

Note: This is early stages so the API is subject to change.

Install

cargo add tinted-scheme-extractor

Usage

use std::path::PathBuf;
use tinted_scheme_extractor::{create_scheme_from_image, SchemeParams, System, Variant};

fn main() {
    let image_path = PathBuf::from("./path/to/file.png");
    let name = "Your scheme name".to_string();
    let slug = "your-scheme-slug".to_string();
    let description = Some("Optional description".to_string());
    let variant = Variant::Dark;
    let system = System::Base16;
    let verbose = false;
    let author = "Your name".to_string();

    let scheme = create_scheme_from_image(SchemeParams {
        image_path,
        author,
        description,
        name,
        slug,
        system,
        verbose,
        variant,
    }).unwrap();

    println!("{}", &scheme);
}

Inspiration

Initially I wasn't sure if I wanted to continue Flavours development or to build something new. I brought this up with Misterio77 and he suggested building something new from scratch. This project is a part of rebuilding the Flavours functionality in Tinty.

Commit count: 23

cargo fmt