Pi66

walrs
pywal but if its Fast-Minimal-Simple
git clone https://git.pi66.xyz/walrs

← back to log

Bug:Fix ColorThief color limite

author: pixel2175
date: 2025-06-22 00:12
hash: 061568258ac8c25019fb2e150145e110a86bdc4f

Diffstat:

M

src/get_colors.rs
7 +++++++++++++++++-------------
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/src/get_colors.rs b/src/get_colors.rs
index 9d6a5ae..f6caef5 100644
--- a/src/get_colors.rs
+++ b/src/get_colors.rs
@@ -121,19 +121,20 @@ fn extract_colors(
         "palette_extract" => palette_extract_colors(10, native_rgba, send),
         "all" => {
             let mut collected: Vec<(u8, u8, u8)> = Vec::new();
-            kmeans_colors(len, native_rgba).iter().for_each(|c| {
+            kmeans_colors(len - 2, native_rgba).iter().for_each(|c| {
                 collected.push(*c);
             });
-            color_thief_colors(len / 3_u8, native_rgba)
+            color_thief_colors(len / 3_u8 + 2, native_rgba)
                 .iter()
                 .for_each(|c| {
                     collected.push(*c);
                 });
-            palette_extract_colors(len / 3_u8, native_rgba, send)
+            palette_extract_colors(len / 3_u8 + 2, native_rgba, send)
                 .iter()
                 .for_each(|c| {
                     collected.push(*c);
                 });
+
             collected
         }
         &_ => {