design.contrast
Každé popředí, které design klade na pozadí, v obou motivech, změřené proti WCAG 2.1 AA: dvojice, položky palety za ní, poměr a práh. Dvojice nejsou seznam — odvozují se z deklarace, která řadí text každého stavu na jeho vlastní pozadí, a z primitiv, které ji využívají, kde pravidlo nastavující barvu a pozadí vyjadřuje dvojici a pravidlo nastavující jen barvu vyjadřuje popředí, které dopadne na každé pozadí, jež kontejner nastaví. Dvojice pod prahem je zjištění, které pojmenovává roli, pozadí, motiv, naměřený poměr a požadovaný.
Každé popředí, které design klade na pozadí, v obou motivech, změřené proti WCAG 2.1 AA: dvojice, položky palety za ní, poměr a práh. Dvojice nejsou seznam — odvozují se z deklarace, která řadí text každého stavu na jeho vlastní pozadí, a z primitiv, které ji využívají, kde pravidlo nastavující barvu a pozadí vyjadřuje dvojici a pravidlo nastavující jen barvu vyjadřuje popředí, které dopadne na každé pozadí, jež kontejner nastaví. Dvojice pod prahem je zjištění, které pojmenovává roli, pozadí, motiv, naměřený poměr a požadovaný.
- query
- behaviorally_verified
- module design
- #design
- #ui
- #accessibility
- #introspection
Zpřístupnění
Kde je tato jedna definice dosažitelná. Absence je explicitní: povrch, který není uveden, ji nenese.
| povrch | jako |
|---|---|
| MCP | nástroj majordomus_design_contrast |
| HTTP | GET /api/v1/design/contrast operationId design.contrast |
| příkazová řádka | — |
Schémata
Kanonický vstup a výstup z typů Rustu; schéma nástroje MCP a parametry a odpovědi OpenAPI se odvozují z nich.
vstup · Prázdné
Žádné vlastnosti: schopnost nebere žádný vstup.
JSON Schema
{
"additionalProperties": false,
"description": "No input.",
"title": "Empty",
"type": "object"
}output · ContrastReport
| vlastnost | typ | povinné | popis |
|---|---|---|---|
| složeno | integer | ano | Deklarace přeskočené, protože jejich hodnota se skládá za běhu. |
| zjištění | array | ano | Jeden řádek na každou vynucovanou dvojici, která nedosahuje, s názvem role, podkladu, motivu, naměřeného poměru a požadovaného poměru. |
| otisk | string | ano | Otisk měřené deklarace. |
| naměřeno | integer | ano | Kolik dvojic bylo odvozeno a změřeno. |
| minimum_non_text | číslo | ano | Poměr požadovaný od netextového prvku, který nese význam. |
| minimum_text | číslo | ano | Poměr požadovaný od textu. |
| dvojice | array | ano | Každý pár ve stabilním pořadí: téma, pak co nese, pak oba tokeny. |
| čitelné | boolean | ano | Zda každá vynucená dvojice dosahuje svého prahu. |
| zdroje | array | ano | Přečtené stylesheety a zda byl každý nalezen. |
| standard | string | ano | Standard, z něhož prahy pocházejí. |
JSON Schema
{
"$defs": {
"Carries": {
"description": "What a colour is doing where it was found.",
"oneOf": [
{
"const": "text",
"description": "Text: held to `MINIMUM_TEXT`.",
"type": "string"
},
{
"const": "non_text",
"description": "A border or an outline: measured against `MINIMUM_NON_TEXT`, reported, not enforced.",
"type": "string"
}
]
},
"Measured": {
"description": "One measured pair: a foreground on a ground, in one theme.",
"properties": {
"carries": {
"$ref": "#/$defs/Carries",
"description": "Text, or a border."
},
"enforced": {
"description": "Whether falling short is a finding. False for a border; see the module documentation.",
"type": "boolean"
},
"foreground": {
"description": "The foreground token, as the declaration names it (`muted`, `ok`).",
"type": "string"
},
"foreground_entry": {
"description": "The palette entry it resolves to in this theme.",
"type": "string"
},
"foreground_value": {
"description": "The literal that entry holds.",
"type": "string"
},
"ground": {
"description": "The ground token.",
"type": "string"
},
"ground_entry": {
"description": "The palette entry the ground resolves to in this theme.",
"type": "string"
},
"ground_value": {
"description": "The literal that entry holds.",
"type": "string"
},
"passes": {
"description": "Whether it reaches it.",
"type": "boolean"
},
"ratio": {
"description": "The measured ratio, to two decimal places.",
"format": "double",
"type": "number"
},
"required": {
"description": "What the standard asks of this pair.",
"format": "double",
"type": "number"
},
"seen": {
"description": "Where the pair was read: the stylesheet and the selector that states it.",
"type": "string"
},
"theme": {
"description": "`light` or `dark`.",
"type": "string"
}
},
"required": [
"foreground",
"foreground_entry",
"foreground_value",
"ground",
"ground_entry",
"ground_value",
"theme",
"carries",
"ratio",
"required",
"passes",
"enforced",
"seen"
],
"type": "object"
},
"Source": {
"description": "One stylesheet the pair set was derived from.",
"properties": {
"path": {
"description": "Where it was read from, as the caller named it.",
"type": "string"
},
"rules": {
"description": "How many rules of it state a colour.",
"format": "uint",
"minimum": 0,
"type": "integer"
}
},
"required": [
"path",
"rules"
],
"type": "object"
}
},
"description": "Every pair the declaration and its consumers state, measured.",
"properties": {
"composed": {
"description": "Declarations skipped because their value is composed at run time.",
"format": "uint",
"minimum": 0,
"type": "integer"
},
"findings": {
"description": "One line per enforced pair that falls short, naming role, ground, theme, measured\nratio and required ratio.",
"items": {
"type": "string"
},
"type": "array"
},
"fingerprint": {
"description": "The fingerprint of the declaration measured.",
"type": "string"
},
"measured": {
"description": "How many pairs were derived and measured.",
"format": "uint",
"minimum": 0,
"type": "integer"
},
"minimum_non_text": {
"description": "The ratio asked of a non-text element that carries meaning.",
"format": "double",
"type": "number"
},
"minimum_text": {
"description": "The ratio asked of text.",
"format": "double",
"type": "number"
},
"pairs": {
"description": "Every pair, in a stable order: theme, then what it carries, then the two tokens.",
"items": {
"$ref": "#/$defs/Measured"
},
"type": "array"
},
"readable": {
"description": "Whether every enforced pair reaches its threshold.",
"type": "boolean"
},
"sources": {
"description": "The stylesheets read, and whether each was found.",
"items": {
"$ref": "#/$defs/Source"
},
"type": "array"
},
"standard": {
"description": "The standard the thresholds come from.",
"type": "string"
}
},
"required": [
"fingerprint",
"standard",
"minimum_text",
"minimum_non_text",
"sources",
"measured",
"pairs",
"composed",
"findings",
"readable"
],
"title": "ContrastReport",
"type": "object"
}Politiky
- benchmark
- povinné — cíl na každém transportu, který expozice deklaruje; případy jsou ty ze vstupního typu
- cache
- vypnuto — každé volání spustí handler
Cíle benchmarku
Odvozeno z registru pro tento repozitář: jeden požadavek na transport a případy, které poskytuje typ vstupu. Celá matice je na stránce měření výkonu.