engine/names library

Deterministic procedural theme names (research theme-engine.md §10, Recommendation 12): Colour Material, Mood Colour, Colour Time/Place and Material Mood-noun.

The colour word follows the real OKLCH hue bucket of the theme's dominant accent (the operator face). Every list has a fixed size, so a bad word is replaced in place and only names using that slot change. Word lists are part of engineVersion. English only in v1; names are recomputed on the receiving device, so localisation never breaks share codes.

Curation rules: no words for people, skin, ethnicity, nationality, religion, body parts, drugs, weapons or violence, and no trademarks. A unit test enumerates every combination against isBlockedName.

Enums

NamePattern
Name patterns with their integer weights.

Constants

blockedBigrams → const List<(String, String)>
Two words that must never appear together (checked on the pair, in either order).
blockedInitials → const List<String>
Blocked two-letter initials.
blockedJoinSubstrings → const List<String>
Offensive substrings that must not be created by joining two words (a substring already inside one word, like "ass" in "Glass", is fine).
blockedWords → const List<String>
Words that must never appear at all (curation guard).
colourSlots → const int
Words per hue bucket (fixed).
colourWords → const List<List<String>>
12 hue buckets of 30°, bucket 0 centred on 0° (345°–15°), each exactly colourSlots words.
darkTimePlaceWords → const List<String>
Time / place words for dark themes (8).
familyMaterialWords → const Map<ThemeFamily, List<String>>
Material / texture words per family (8 each); genericMaterialWords for families without their own list.
genericMaterialWords → const List<String>
Fallback material words (8).
lightTimePlaceWords → const List<String>
Time / place words for light themes (8).
moodNouns → const List<String>
Mood nouns (8).
moodWords → const List<String>
Mood adjectives (16).
neutralChromaThreshold → const double
Accents with OKLCH chroma below this use neutralWords.
neutralWords → const List<String>
Neutral colour words (accent chroma < neutralChromaThreshold).

Functions

colourWordsFor(int accentArgb) → List<String>
Colour words for an accent colour: its hue bucket, or neutralWords.
generateThemeName({required Rng rng, required int accentArgb, required ThemeFamily family, required bool dark}) → String
The name of a theme: deterministic from the name stream rng, the final palette's accentArgb (operator face), the family and whether it is dark.
hueBucket(double hueDeg) → int
Hue bucket 0–11 of an OKLCH hue in degrees (bucket 0 = 345°–15°).
isBlockedName(String first, String second) → bool
Whether the two-word name first second is blocked: a blocked word, a blocked bigram, a blocked substring created by the join, or blocked initials.
materialWordsFor(ThemeFamily family) → List<String>
Material words for family.