Improved color picker algorithm

This commit is contained in:
Alexey 2025-09-18 16:35:30 +03:00
commit ca3c171698

View file

@ -19,5 +19,4 @@ pub fn color_id_from_name(name: String) -> i32 {
let mut s = DefaultHasher::new(); let mut s = DefaultHasher::new();
name.hash(&mut s); name.hash(&mut s);
let hash = s.finish(); let hash = s.finish();
(hash.count_ones() / 4) as i32 (hash % 16) as i32 }
}