mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-19 00:51:28 +03:00
peers
This commit is contained in:
@@ -127,3 +127,11 @@ class _PasswordWidgetState extends State<PasswordWidget> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Color str2color(String str, [alpha = 0xFF]) {
|
||||
var hash = 160 << 16 + 114 << 8 + 91;
|
||||
for (var i = 0; i < str.length; i += 1) {
|
||||
hash = str.codeUnitAt(i) + ((hash << 5) - hash);
|
||||
}
|
||||
return Color((hash & 0xFFFFFF) | (alpha << 24));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user