#color-scheme #color-themes #base-16 #themes #tinted-theming #generate

tinted-scheme-extractor

A tool to create a Tinted Theming scheme based on a provided image

10 releases (5 breaking)

0.6.0 Dec 20, 2024
0.5.0 Oct 5, 2024
0.4.0 Sep 23, 2024
0.3.2 Jul 12, 2024
0.1.0 Jun 16, 2024

#259 in Images

Download history 186/week @ 2024-09-18 157/week @ 2024-09-25 242/week @ 2024-10-02 72/week @ 2024-10-09 19/week @ 2024-10-16 15/week @ 2024-10-23 1/week @ 2024-10-30 4/week @ 2024-11-06 25/week @ 2024-11-13 14/week @ 2024-11-20 3/week @ 2024-11-27 44/week @ 2024-12-04 28/week @ 2024-12-11 164/week @ 2024-12-18 26/week @ 2024-12-25 14/week @ 2025-01-01

245 downloads per month
Used in tinty

MPL-2.0 license

33KB
695 lines

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, SchemeSystem, SchemeVariant};

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.

Dependencies

~12–24MB
~314K SLoC