Language support

September 1, 2026 · View on GitHub

Language resources live in ovos_color_parser/res/<locale>/ as JSON wordlists mapping hex codes to names. A requested language tag resolves to the best-matching bundled locale: exact case-insensitive tag first (pt-brpt-BR), then any locale sharing the primary language subtag (en, en-GBen-US). Unsupported languages make color_from_description return None and palette_from_description return an empty palette.

Feature matrix

LocaleLanguageColor name entriesModifier keywords¹Object colors²
an-ESAragonese14nono
ar-SAArabic72yesyes
ast-ESAsturian17nono
bg-BGBulgarian32nono
ca-ESCatalan3421nono
cs-CZCzech54nono
da-DKDanish14712yesyes
de-DEGerman1548yesno
en-USEnglish14712yesyes
es-ESSpanish7250yesno
eu-ESBasque8011yesno
fr-FRFrench14712yesyes
fy-NLWest Frisian15nono
hr-HRCroatian30nono
it-ITItalian6820yesno
kab-DZKabyle12nono
nl-NLDutch101nono
oc-FROccitan23yesno
pl-PLPolish173nono
pt-BRPortuguese8238yesyes
ro-RORomanian101yesno
ru-RURussian216nono
sk-SKSlovak35nono

23 locales. color_from_description accepts any BCP-47 tag and resolves it to the closest bundled locale.

¹ color_descriptors.json: saturation/brightness/temperature/opacity adjectives ("dark", "vivid", "warm", "transparent"). Locales without it still match color names. Modifiers are simply ignored.

² object_colors.json: prototypical object colors ("carrot", "banana", "blood").

Every public function accepts every language: locales lacking a resource degrade gracefully instead of raising.

The largest wordlists (Danish, English, French) share the full ~14.7k-entry set covering web colors, the xkcd survey, crayola, RAL, Pantone and more. Smaller locales ship curated basic and traditional color terms. They resolve common names accurately but will snap unusual descriptions to a nearer basic color.

Arabic notes

Arabic ships four color wordlists plus object colors and modifier keywords. colors.json holds Modern Standard Arabic (fuṣḥā) basic and extended shades: teal (أزرق مخضر), cyan (سيان), coral (مرجاني), lavender (خزامي), khaki (كاكي), mustard (خردلي), mint (نعناعي), amber (كهرماني), burgundy (عنابي) and more.

dialectal_colors.json adds colloquial terms spanning the major dialect areas: Egyptian (بمبي pink, لبني light blue, بترولي petrol), Levantine/Shami (روز rose, جوزي walnut brown), Gulf/Khaleeji (قهوائي coffee-brown, عسلي honey, سكري sugar-cream), Iraqi (طوبي brick-red, جكليتي chocolate-brown) and Maghrebi/Darija (بلو blue). Multiple names map to a shared hex, so synonyms and dialectal variants resolve to the same color.

Arabic tashkeel (the optional short-vowel and other diacritic marks) are removed during normalization, so a word matches whether it is written bare or fully vowelled. أحمر and أَحْمَر resolve to the same color, and the same holds for dialectal names and modifier phrases.

Letter-form differences are not diacritics and are handled as data. orthographic_variants.json ships the spellings a user might type differently: the hamza-less initial alef (احمر for أحمر) and alef-maqṣūra for final yāʾ (بنفسجى). object_colors.json maps prototypical objects to their color, including dialectal object words (طماطم vs Levantine بندورة for tomato, موز banana-yellow, سماء sky-blue, دم blood-red, ذهب gold). color_descriptors.json covers Standard and dialectal modifiers for brightness, saturation, temperature and opacity (dark غامق/غانق, light فاتح/فاقع).

Very short names, such as the two-letter دم (blood), match only as whole words, never fuzzily. An unrelated word that merely contains them, such as قدم (foot) or بنيان (building), is not misread as a color.

Kabyle notes

Kabyle colexifies blue and green: azegzaw covers both and is mapped to both hexes ("grue"). anili (indigo), azenǧǧari (sky blue) and amuri (navy) name specific blues. adal, azemmuri (olive) and aqesli (light green) are attested greens. Only attested terms ship. Modifier keywords are omitted for lack of sources.

Wordlist sources

Depending on the locale, wordlists include translations of: basic colors, the xkcd color survey, crayola crayons, RAL classic/design/effect/plastics, Pantone, ISCC-NBS, .NET named colors, traditional Japanese colors and Wikipedia's list of colors.

Adding a language

See extending.md for the step-by-step guide to adding a locale, shipping custom wordlists, and enabling modifier keywords.


← API reference · Home · Extending →