Improved color picker algorithm
This commit is contained in:
parent
218ee49a8b
commit
ca3c171698
1 changed files with 1 additions and 2 deletions
|
@ -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 }
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue