One Rule Instead of a Hundred Colours

A gradient from blue to white, a printing ink you want twenty strengths of, a curve that lifts colours that came out too dark: in all three there is no one colour to write down, there is a rule that makes every one of them. Writing the colours out one by one means hundreds of lines inside the file and a document heavier than it needs to be; writing the rule down means three lines, and reading software works out the rest. The first page shows the four kinds of rule a PDF knows how to follow, with the rule that drew each panel printed under it.

The first is a table: you give the colour at seven points along the way and reading software draws the line between them, which is what you want when the colours come off a measurement and no formula would ever land on them. The second is a short piece of working reading software runs itself, and it does what no table can — the panel it draws cuts the range into seven flat bands instead of sliding, which is how a shaded map is made to read at a glance. The third is that same working applied to one printing ink, so a press ink can be shown on a screen that has never seen it. The fourth is two of the others joined end to end, one covering the first half of the range and one the second, which is how a gradient changes its mind halfway without being cut into two shapes. The two pages after it go further. The second gives every operation that short piece of working can use — arithmetic, rounding, roots, angles, logarithms, comparisons and choices — a grey strip of its own, with the working printed beneath it. The third stores one table of five greys at every precision a table allows, from the coarsest, which knows only black and white, to the finest; then it fills the gaps along a curve instead of straight lines, reads a table back to front, and joins three kinds of rule end to end.

What This Example Shows

  • The four kinds: a table of measured colours, a short piece of working, a rule for one ink, and two rules joined end to end.
  • The rule that drew each panel printed under it, to read together.
  • What every gradient and every named ink on this site is built on.

The Source Code, Complete

Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library. The third is the description itself: a plain list of what the page has to say, which is what the service is sent.

Read the Rust source Read the Python source Read the JSON source

The Document Itself

Open the document in English Open the document in French Open the document in German Open the document in Spanish Open the document in Italian Open the document in Portuguese

One Rule Instead of a Hundred Colours, first page

In the API Reference

The Same Document in Other Languages

This document weighs 32.8 kB

Examples Near This One

Grey, Screen and Printing Colours

Swatches in each of the three ways to say a colour — a grey as one number, a screen colour as three, a printing colour as four inks — each captioned with the instruction actually written into the file, and one mid-grey said four ways, the last as the hexadecimal code a screen designer hands over.

Colour the Document Defines

The same six colours said as bare numbers and then read through the screen profile the file carries, plus a ramp from light to dark and a sweep of measured hues: colour that still means the same thing on another screen and on a press.

Several Plates at Once, Each at Its Own Strength

Eight choices of plate among the four usual inks, each with the small program that shows it printed underneath, and two inks the press carries itself used together, every strength of one against every strength of the other.

A Colour Chart the Drawing Points Into

A chart of house colours the file carries, and a drawing whose sixteen numbers are places in that chart rather than colours. The same drawing is shown twice through two charts: repainting a whole brand is one chart, not every drawing.

One Hatch, Laid Down in Any Colour You Like

One pattern that states no colour of its own, laid down in five colours and in five strengths of one press ink: the fill says what colour to lay it down in. Beside them, the same hatch made of patterns that carry their own colours, which is one pattern per colour.

Every example, by subject