Fix typos
This commit is contained in:
parent
7b5626c279
commit
4b4e5cb289
16 changed files with 50 additions and 62 deletions
|
@ -1,5 +1,5 @@
|
|||
// this code is taken from https://github.com/MCorange99/svg2colored-png/tree/main
|
||||
// I was unable to figure out how to use usvg myself so younked it from here.
|
||||
// I was unable to figure out how to use usvg myself so yoinked it from here.
|
||||
|
||||
use std::{
|
||||
ffi::OsStr,
|
||||
|
@ -7,7 +7,6 @@ use std::{
|
|||
sync::Arc,
|
||||
};
|
||||
|
||||
// use clap::builder::OsStr;
|
||||
use color_eyre::{eyre::bail, Result};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
@ -17,7 +16,7 @@ pub struct Args {
|
|||
/// Output folder where the PNG's will be placed
|
||||
pub output: PathBuf,
|
||||
|
||||
/// Comma seperated colors that will be used in HEX Eg. 000000,ffffff
|
||||
/// Comma separated colors that will be used in HEX Eg. 000000,ffffff
|
||||
/// Can be like an object: black:000000,white:ffffff
|
||||
pub colors: String,
|
||||
|
||||
|
@ -56,7 +55,6 @@ impl Renderer {
|
|||
};
|
||||
|
||||
this.colors = if args.colors.contains(':') {
|
||||
//? object
|
||||
let obj = args.colors.split(',').map(|s| {
|
||||
let mut iter = s.split(':');
|
||||
let [Some(a), Some(b), None] = std::array::from_fn(|_| iter.next()) else {
|
||||
|
@ -77,12 +75,6 @@ impl Renderer {
|
|||
|
||||
ColorType::Object(colors)
|
||||
} else {
|
||||
//? list
|
||||
// let colors = args.colors.split(",").map(|s| {
|
||||
// s.to_string()
|
||||
// })
|
||||
// .collect::<Vec<String>>();
|
||||
|
||||
let colors = args
|
||||
.colors
|
||||
.split(',')
|
||||
|
@ -158,9 +150,6 @@ impl Renderer {
|
|||
x.min(y)
|
||||
};
|
||||
|
||||
// log::info!("Rendering {fo:?}");
|
||||
|
||||
//? maybe handle this and possibly throw error if its none
|
||||
resvg::render(&tree, usvg::Transform::default().post_scale(scale, scale), &mut pixmap.as_mut());
|
||||
|
||||
pixmap.save_png(fo)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue