Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added hyprpicker as --color-picker #186

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cli/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
.short('s')
.value_name("name")
.help("The colorspace in which to interpolate")
.possible_values(&["Lab", "LCh", "RGB", "HSL"])

Check warning on line 41 in src/cli/cli.rs

View workflow job for this annotation

GitHub Actions / Code quality

the borrowed expression implements the required traits
.ignore_case(true)
.default_value("Lab");

Expand Down Expand Up @@ -95,7 +95,7 @@
\n\
Default strategy: 'vivid'\n ",
)
.possible_values(&["vivid", "rgb", "gray", "lch_hue"])

Check warning on line 98 in src/cli/cli.rs

View workflow job for this annotation

GitHub Actions / Code quality

the borrowed expression implements the required traits
.hide_default_value(true)
.hide_possible_values(true)
.default_value("vivid"),
Expand Down Expand Up @@ -131,7 +131,7 @@
.help("Distance metric to compute mutual color distances. The CIEDE2000 is \
more accurate, but also much slower.")
.takes_value(true)
.possible_values(&["CIEDE2000", "CIE76"])

Check warning on line 134 in src/cli/cli.rs

View workflow job for this annotation

GitHub Actions / Code quality

the borrowed expression implements the required traits
.value_name("name")
.default_value("CIE76")
)
Expand Down Expand Up @@ -192,6 +192,7 @@
- KColorChooser (https://kde.org/applications/graphics/org.kde.kcolorchooser)\n \
- zenity (https://wiki.gnome.org/Projects/Zenity)\n \
- yad (https://github.com/v1cont/yad)\n \
- hyprpicker (https://github.com/hyprwm/hyprpicker)\n \
- macOS built-in color picker")
.arg(
Arg::new("count")
Expand All @@ -210,7 +211,7 @@
.help("Output format type. Note that the 'ansi-*-escapecode' formats print \
ansi escape sequences to the terminal that will not be visible \
unless something else is printed in addition.")
.possible_values(&["rgb", "rgb-float", "hex",

Check warning on line 214 in src/cli/cli.rs

View workflow job for this annotation

GitHub Actions / Code quality

the borrowed expression implements the required traits
"hsl", "hsl-hue", "hsl-saturation", "hsl-lightness",
"hsv", "hsv-hue", "hsv-saturation", "hsv-value",
"lch", "lch-lightness", "lch-chroma", "lch-hue",
Expand Down Expand Up @@ -338,7 +339,7 @@
Arg::new("type")
.help("The type of colorblindness that should be simulated (protanopia, \
deuteranopia, tritanopia)")
.possible_values(&["prot", "deuter", "trit"])

Check warning on line 342 in src/cli/cli.rs

View workflow job for this annotation

GitHub Actions / Code quality

the borrowed expression implements the required traits
.ignore_case(true)
.required(true),
)
Expand All @@ -353,7 +354,7 @@
.arg(
Arg::new("property")
.help("The property that should be changed")
.possible_values(&["lightness", "hue", "chroma",

Check warning on line 357 in src/cli/cli.rs

View workflow job for this annotation

GitHub Actions / Code quality

the borrowed expression implements the required traits
"lab-a", "lab-b",
"red", "green", "blue",
"hsl-hue", "hsl-saturation", "hsl-lightness"])
Expand Down Expand Up @@ -487,7 +488,7 @@
.short('m')
.value_name("mode")
.help("Specify the terminal color mode: 24bit, 8bit, off, *auto*")
.possible_values(&["24bit", "8bit", "off", "auto"])

Check warning on line 491 in src/cli/cli.rs

View workflow job for this annotation

GitHub Actions / Code quality

the borrowed expression implements the required traits
.default_value(if output_vt100::try_init().is_ok() {"auto"} else {"off"})
.hide_possible_values(true)
.hide_default_value(true)
Expand Down
7 changes: 7 additions & 0 deletions src/cli/colorpicker_tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ pub static COLOR_PICKER_TOOLS: Lazy<Vec<ColorPickerTool>> = Lazy::new(|| {
version_output_starts_with: b"",
post_process: None,
},
ColorPickerTool {
command: "hyprpicker",
args: &[],
version_args: &["-h"],
version_output_starts_with: b"",
post_process: None,
},
#[cfg(target_os = "linux")]
ColorPickerTool {
command: "gdbus",
Expand Down
Loading