EN, Change language
Englishالعربية
Criterion 2 · FoundationsMachine-measured

Ensure the use of approved colors as defined in the Unified Design System (Platforms Code)

Every colour value on the page must come from the approved palette, without modification and without substitution by a near neighbour. A colour one or two steps off the official green is still a deviation, and the one that most often survives a visual review: near colours make the criterion partly applied, and clearly different colours above 40% of usages make it not applied.

It is one of the primary criteria in the foundations group of the Saudi Platforms Code, issued by the Digital Government Authority.

How xfix gov measures this criterion

The applied value is read from the page and compared with the value approved in the Platforms Code, so the verdict comes from a measurement rather than an estimate, and the observed and expected values are attached together. The contrast of every visible text against its background as painted is measured too (checkpoint b), at 4.5:1 under 24px and 3:1 above; text on a picture or a gradient is not measured or counted.

The official text and its checkpoints

This criterion rests on 2 checkpoints published in the Platforms Code, and they are the reference when judging it.

This criterion on the official Platforms Code site

The checkpoints, one by one

Each checkpoint below has its own answer: what it requires, what passes and what fails, how it is measured or verified, and how it is repaired. Each has a direct link.

  1. Approved colour values, unmodified

    Machine-measuredDGA-002-a

    Every colour value on the page must come from the Platforms Code palette (backgrounds, text, borders and the rest) with no change to the value and no substitution by a near neighbour. A near-miss colour is still a deviation even when the eye misses it: untokenised near colours make the checkpoint partly applied, and clearly different or foreign colours above 40% of usages make it not applied.

    xfix gov measures this checkpoint automatically, and attaches the observed value and the expected value together.

    What passes: Every colour observed on the page matches an approved palette value, whether written as a variable or as a literal.

    What fails: A value close to the approved one without equalling it: a green one or two steps off the official green. This is the most frequent violation precisely because it survives a visual review.

    How it is measured or verified: The tool counts every declared colour value across the sampled pages and compares each with the palette by computed colour distance, separating exact matches from near ones. A violation is reported once per value with a usage count, not once per element. Text colour is read from visible text only, and a semi-transparent colour is not measured, since it takes the colour of what lies beneath.

    How it is repaired: Replace literal values with palette variables in the stylesheet, so library updates reach them automatically. Start with the most-used value: least work, largest effect.

  2. Contrast on coloured backgrounds, and the On Color property

    Machine-measuredDGA-002-b

    Any element placed on a coloured background must meet the required contrast ratio for accessibility, using the On Color property built into Platforms Code components. What counts is composited contrast as the user actually sees it, not the contrast assumed.

    xfix gov measures this checkpoint automatically, and attaches the observed value and the expected value together.

    What passes: White or dark text on a coloured background reaching 4.5:1 for small text and 3:1 for large text and graphical elements, taken from the On Color variable rather than chosen by hand.

    What fails: Text at step 600 of the ramp on a light background: the value is official and the result is below the threshold, because 600 is a fill step and 700 is the text step.

    How it is measured or verified: The tool measures the contrast of every visible text against its background as actually painted, translucent layers composited, and compares it with the official colour page: 4.5:1, or 3:1 for text from 24px or bold from 18.66px. All text is measured, not only text on coloured backgrounds, and the contrast of graphical elements is not. Text on a picture or a gradient is not measured or counted, and the report says how much. A failure is reported once per colour and background pair, with a usage count.

    How it is repaired: Use the On Color variable that accompanies the background colour instead of picking the text colour by hand, and move small text from step 600 to step 700.

Related criteria

xfix gov is an independent tool, not part of the Digital Government Authority, and what it produces is an indicative estimate, not the Platforms Code Application Certificate. The limits of this tool.

Colour: Platforms Code criterion 2 | xfix