unify peer color

This commit is contained in:
rustdesk
2021-08-14 14:14:01 +08:00
parent c17f48c128
commit f226ede64b
3 changed files with 12 additions and 7 deletions

View File

@@ -174,5 +174,6 @@ Color str2color(String str, [alpha = 0xFF]) {
for (var i = 0; i < str.length; i += 1) {
hash = str.codeUnitAt(i) + ((hash << 5) - hash);
}
return Color((hash & 0xFFFFFF) | (alpha << 24));
hash = hash % 16777216;
return Color((hash & 0xFF7FFF) | (alpha << 24));
}