Functions, the shape a colour follows

What a function says a colour does, in each of its four kinds: a spectrum read off a table of values, a ramp cut into bands by a small calculation, an ink whose conversion recipe is a program printed under its swatches, and a table joined end to end between two ends.

A gradient, a spot ink, a correction curve: in each case one number goes in and several come out, and the file says how. There are four kinds of function in the format, and this page draws one panel for each, with the program printed under what it draws.

A spectrum read off a table of values, a stepped ramp worked out by a small program, an ink whose conversion recipe is a program of its own, and a table joined end to end between two ends. Anything else on this site that involves a gradient or a separated ink is built on one of these four.

What this example shows

  • The four kinds: from a table of values, from a curve, by joining, and by a small PostScript program.
  • Each function's program printed under the panel it draws.
  • The building block gradients and spot inks are made of.

The code, in full

The same document is written twice, once in each language. Both files are shown in full, with the code coloured on the server, and can be copied in one click.

The document itself

The same document is written in each of these languages. Open the one you want to look at.

Open the document in English Open the document in French

Read the Rust source Read the Python source

First page of Functions, the shape a colour follows

What this document weighs

Before 114,356 bytes
Now 44,092 bytes
Saved 61.4 %

Not one mark on the page changed. See every document measured.

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 three ways.

Colour the document defines

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

Inks on plates of their own

Two inks the press carries on a plate of their own, each at ten strengths, a piece of work set in both, and the crosses used to line the plates up — drawn in an ink every plate answers to.

Several plates at once, each at a strength of its own

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 chart of colours, and a drawing that names places in it

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 table, not every drawing.

One hatch, laid down in as many colours as the page asks for

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

Glossary

CMYK
The four inks a printing press lays down: cyan, magenta, yellow and black. A screen mixes light instead, so a document going to a press states its colours in inks, not in screen colours.