Skip to content
Snippets Groups Projects
Commit d78f721e authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Nicolas Jager
Browse files

ui: sync with default avatar color palette used by other clients

- shares the color palette with gnome/win32 clients taken from
  https://material.io/guidelines/style/color.html



Change-Id: I9ce12992d0ef5cb86e77a64d2bbde03a379ea342
Reviewed-by: default avatarNicolas Jäger <nicolas.jager@savoirfairelinux.com>
parent 5dbf18e4
Branches
Tags
No related merge requests found
...@@ -473,30 +473,25 @@ ColorFromString(String^ s) ...@@ -473,30 +473,25 @@ ColorFromString(String^ s)
return Windows::UI::ColorHelper::FromArgb(255, 0, 0, 0); return Windows::UI::ColorHelper::FromArgb(255, 0, 0, 0);
} }
// 21 XBOX/Web ready colors // 16 Web ready colors
// https://docs.microsoft.com/en-us/windows/uwp/style/color // https://material.io/guidelines/style/color.html#color-color-palette
auto colorStrings = ref new Vector<String^>({ auto colorStrings = ref new Vector<String^>({
"#ffEB8C10", "#fff44336", // { 0.956862, 0.262745, 0.211764 } #fff44336 // red 244, green 67, blue 54 (red)
"#ffED5588", "#ffe91e63", // { 0.913725, 0.117647, 0.388235 } #ffe91e63 // red 233, green 30, blue 99 (pink)
"#ff1073D6", "#ff9c27b0", // { 0.611764, 0.152941, 0.690196 } #ff9c27b0 // red 156, green 39, blue 176 (purple)
"#ff148282", "#ff673ab7", // { 0.956862, 0.262745, 0.211764 } #ff673ab7 // red 244, green 67, blue 54 (deep purple)
"#ff107C10", "#ff3f51b5", // { 0.403921, 0.227450, 0.717647 } #ff3f51b5 // red 103, green 58, blue 183 (indigo)
"#ff4C4A4B", "#ff2196f3", // { 0.247058, 0.317647, 0.211764 } #ff2196f3 // red 63, green 81, blue 54 (blue)
"#ff00CC6A", "#ff00bcd4", // { 0, 0.737254, 0.831372, 1.0 } #ff00bcd4 // red 0, green 188, blue 212 (cyan)
"#ffBF1077", "#ff009688", // { 0, 0.588235, 0.533333, 1.0 } #ff009688 // red 0, green 150, blue 136 (teal)
"#ff193E91", "#ff4caf50", // { 0.298039, 0.682745, 0.313725 } #ff4caf50 // red 76, green 175, blue 80 (green)
"#ff54A81B", "#ff8bc34a", // { 0.545098, 0.764705, 0.290196 } #ff8bc34a // red 138, green 194, blue 73 (light green)
"#ff737373", "#ff9e9e9e", // { 0.619607, 0.619607, 0.619607 } #ff9e9e9e // red 157, green 157, blue 157 (grey)
"#ff7E715C", "#ffcddc39", // { 0.803921, 0.862745, 0.223529 } #ffcddc39 // red 204, green 219, blue 56 (lime)
"#ff6B69D6", "#ffffc107", // { 1, 0.756862, 0.027450, 1.0 } #ffffc107 // red 255, green 192, blue 6 (amber)
"#ffB144C0", "#ffff5722", // { 1, 0.341176, 0.133333, 1.0 } #ffff5722 // red 255, green 86, blue 33 (deep orange)
"#ff1081CA", "#ff795548", // { 0.474509, 0.333333, 0.282352 } #ff795548 // red 120, green 84, blue 71 (brown)
"#ff547A72", "#ff607d8b" // { 0.376470, 0.490196, 0.545098 } #ff607d8b // red 95, green 124, blue 138, (blue grey)
"#ff677488",
"#ff724F2F",
"#ffA21025",
"#ff744DA9",
"#ff108272"
}); });
String^ String^
...@@ -541,14 +536,14 @@ generateRandomNumberInRange(uint32_t min, uint32_t max) ...@@ -541,14 +536,14 @@ generateRandomNumberInRange(uint32_t min, uint32_t max)
String^ String^
getRandomColorString() getRandomColorString()
{ {
auto index = generateRandomNumberInRange(0, 21); auto index = generateRandomNumberInRange(0, colorStrings->Size - 1);
return colorStrings->GetAt(index); return colorStrings->GetAt(index);
} }
String^ String^
getRandomColorStringFromString(String^ str) getRandomColorStringFromString(String^ str)
{ {
auto index = hashToRange(toString(computeMD5(str)), 0, 21); auto index = hashToRange(toString(computeMD5(str)), 0, colorStrings->Size - 1);
return colorStrings->GetAt(index); return colorStrings->GetAt(index);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment