7 个版本
0.3.2 | 2024 年 7 月 12 日 |
---|---|
0.3.1 | 2024 年 7 月 12 日 |
0.2.2 | 2024 年 6 月 18 日 |
0.1.0 | 2024 年 6 月 16 日 |
在 图像 中排名第 220
每月下载量 375
用于 tinty
32KB
668 行
彩色主题提取器
彩色主题提取器
是一个基于提供的图像生成 Base16 主题的 Rust 库。
注意:这处于早期阶段,API 可能会更改。
安装
cargoadd 彩色主题提取器
使用方法
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);
}
灵感
最初我并不确定是否要继续 Flavours 的开发,还是构建一些新的东西。 我与 Misterio77 进行了讨论,他建议从头开始构建一些新的东西。该项目是 Flavours 功能在 Tinty 中的重建的一部分。
依赖项
~10–22MB
~299K SLoC