about summary refs log tree commit diff
path: root/squash/src/cli.rs
diff options
context:
space:
mode:
authorgennyble <gen@nyble.dev>2024-06-10 17:07:56 -0500
committergennyble <gen@nyble.dev>2024-06-10 17:07:56 -0500
commita57cb34b513876313c755be2bbebb63138b4932b (patch)
tree4efd794c2e5df183da0852044e6038912048c9c5 /squash/src/cli.rs
parent67eefd43795320043915d3527fd2716986e049d7 (diff)
downloadcolorsquash-a57cb34b513876313c755be2bbebb63138b4932b.tar.gz
colorsquash-a57cb34b513876313c755be2bbebb63138b4932b.zip
Add HighestBits selector to cli
Diffstat (limited to 'squash/src/cli.rs')
-rw-r--r--squash/src/cli.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/squash/src/cli.rs b/squash/src/cli.rs
index d47d26b..96a0798 100644
--- a/squash/src/cli.rs
+++ b/squash/src/cli.rs
@@ -107,6 +107,7 @@ pub enum Selector {
 	#[default]
 	SortSelect,
 	Kmeans,
+	HighestBits,
 }
 
 pub fn build() -> Cli {
@@ -180,6 +181,7 @@ pub fn build() -> Cli {
 			Some(("selector", sel)) | Some(("sel", sel)) => match sel {
 				"sort/select" | "sorsel" => building.selector = Selector::SortSelect,
 				"kmeans" => building.selector = Selector::Kmeans,
+				"highest-bits" => building.selector = Selector::HighestBits,
 				_ => {
 					eprintln!("'{sel}' is not recognized as a selector. See help=selectors");
 					std::process::exit(1);
@@ -264,6 +266,10 @@ fn print_help_selectors() -> ! {
 	println!("kmeans:");
 	println!("    uses the kmeans clustering algorithm to select colours.");
 	println!("    Ignores tolerance=");
+	println!("highest-bits:");
+	println!("    quantizes the colours by shifting the bits of their components until");
+	println!("    they all fit in the palette.");
+	println!("    Ignores tolerance=");
 	std::process::exit(0)
 }