summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeo_8_A <Neo_8_Anderson@protonmail.com>2023-05-14 18:09:14 -0400
committerNeo_8_A <Neo_8_Anderson@protonmail.com>2023-05-14 18:09:14 -0400
commit1d07479cfde6aa0eda90c28a3475a80dfc124ea1 (patch)
treede0d4cd222ea0da5ee95614d2834abd1b754c420
parent9ceee51ef2c946008e34d16f4b273a29acaef40b (diff)
feat: Added stroke_color option to CLI
Added a few lines of code to allow setting default stroke-color from the CLI. This makes theming easier for those in dark mode. It is consistent with the background and fill_color options already available.
-rw-r--r--Cargo.lock2
-rw-r--r--packages/svgbob_cli/src/main.rs10
2 files changed, 10 insertions, 2 deletions
diff --git a/Cargo.lock b/Cargo.lock
index c4981b0..fe87417 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -908,7 +908,7 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
[[package]]
name = "svgbob"
-version = "0.7.0"
+version = "0.7.1"
dependencies = [
"indexmap",
"itertools",
diff --git a/packages/svgbob_cli/src/main.rs b/packages/svgbob_cli/src/main.rs
index 15a0bb9..08e6031 100644
--- a/packages/svgbob_cli/src/main.rs
+++ b/packages/svgbob_cli/src/main.rs
@@ -43,10 +43,14 @@ fn main() {
.long("font-size")
.takes_value(true)
.help("text will be rendered with this font size (default: 14)"))
- .arg(Arg::with_name("stroke-width")
+ .arg(Arg::with_name("stroke-width")
.long("stroke-width")
.takes_value(true)
.help("stroke width for all lines (default: 2)"))
+ .arg(Arg::with_name("stroke-color")
+ .long("stroke-color")
+ .takes_value(true)
+ .help("stroke color for all lines (default: 'black')"))
.arg(Arg::with_name("scale")
.long("scale")
.takes_value(true)
@@ -123,6 +127,10 @@ fn main() {
settings.stroke_width = stroke_width;
}
+ if let Some(stroke_color) = parse_value_of(&args, "stroke-color") {
+ settings.stroke_color = stroke_color;
+ }
+
let scale: Option<f32> = parse_value_of(&args, "scale");
if let Some(s) = scale {
settings.scale *= s;