branding.insufficient_contrast
The primary colour, or a colour the shared theme generator derives from it, fails WCAG 2.2 AA (4.5:1 for text against its background, 3:1 for interface components and focus indicators) in the light theme, the only partner theme in the first release.
| Code | branding.insufficient_contrast |
|---|---|
| HTTP status | 422 |
| Category | Unprocessable |
| Arguments | pair, colour, against, ratio, required |
What the portals show
The portals translate the code, never the title. The English (en-GB) message, in ICU format with the arguments as placeholders:
This colour does not have enough contrast ({pair}: {ratio}:1, needs {required}:1). Choose a darker shade.
Example response
{
"type": "https://docs.test.konsolutelab.uk/errors/branding.insufficient_contrast",
"title": "…",
"status": 422,
"code": "branding.insufficient_contrast",
"args": {},
"traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01",
"instance": "/api/v1/…"
}Handling it
Branch on code, not on title or the status alone, and log traceId. Codes are stable; new codes may appear, so fall back on the HTTP status for a code you do not know. See Handling errors and the list of codes.