Unify team grid, limit avatars to brand colours, keep duty tags on one line

This commit is contained in:
tleininger committed 2026-10-01 16:04:12 +02:00
1 parent a5a68ed122
commit 602f258257
4 files changed
+72 -72

No files matched your search

+19 -11
View File
@@ -49,13 +49,14 @@ public sealed record TeamMember(string Name, string? Role, IReadOnlyList<string>
public const string ContainerName = "team";
/// <summary>
/// The modifier for larger cards, <c>::: team gross</c>; also the class it adds
/// to the block.
/// The modifier for the chair, <c>::: team gross</c>; also the class it adds to
/// the block. The cards keep the shared raster; only the role chip is
/// highlighted.
/// </summary>
/// <remarks>
/// A word after the block name rather than a block of its own
/// (<c>::: team-gross</c>): the block stays <c>team</c>, so a typo in the
/// modifier only costs the larger size, never the whole grid. <c>groß</c> is
/// modifier only costs the highlight, never the whole grid. <c>groß</c> is
/// accepted too; <c>gross</c> is the documented form because it types the same
/// on every keyboard.
/// </remarks>
@@ -73,9 +74,14 @@ public sealed record TeamMember(string Name, string? Role, IReadOnlyList<string>
/// <summary>
/// How many avatar colours there are; <c>app.css</c> defines
/// <c>--color-avatar-1</c> to <c>--color-avatar-5</c> to match.
/// <c>--color-avatar-1</c> (brand blue) and <c>--color-avatar-2</c> (brand
/// green) to match.
/// </summary>
public const int ColorCount = 5;
/// <remarks>
/// Only the two brand colours: more hues made the board look busy and pulled it
/// away from the IGMH palette.
/// </remarks>
public const int ColorCount = 2;
/// <summary>
/// FNV-1a offset basis and prime (32 bit), see <see cref="Fnv"/>.
@@ -135,14 +141,16 @@ public sealed record TeamMember(string Name, string? Role, IReadOnlyList<string>
/// is a fixed hash (FNV-1a) and not <see cref="string.GetHashCode()"/>, which
/// .NET randomises per process. Surrounding whitespace does not count.
/// <para>
/// FNV-1a alone spreads short names badly over its low bits, which the
/// remainder by <see cref="ColorCount"/> reads: four of the six "Beisitz"
/// members shared one colour. The MurmurHash3 finaliser (<see cref="Mix"/>)
/// stirs all bits into the low ones first.
/// FNV-1a alone spreads short names badly, so the MurmurHash3 finaliser
/// (<see cref="Mix"/>) stirs all bits first. The colour is then taken from
/// the <b>high</b> bits (multiply by <see cref="ColorCount"/>, keep the top
/// 32 bits) rather than a remainder, which would read only the low bits:
/// with two colours that put eight of the ten board members on the same
/// one.
/// </para>
/// </remarks>
public static int ColorOf(string name) =>
(int)(Mix(Fnv(name.Trim())) % ColorCount) + 1;
(int)(((ulong)Mix(Fnv(name.Trim())) * ColorCount) >> 32) + 1;
/// <summary>
/// Reads a person from the first paragraph of a list item.
@@ -207,7 +215,7 @@ public sealed record TeamMember(string Name, string? Role, IReadOnlyList<string>
string.Equals(container.Info, ContainerName, StringComparison.OrdinalIgnoreCase);
/// <summary>
/// Whether a team block asks for larger cards (<c>::: team gross</c>).
/// Whether a team block asks for the chair highlight (<c>::: team gross</c>).
/// </summary>
/// <param name="container">The team block.</param>
/// <returns>