Declaring colour beyond red, green and blue

Name a separate ink, a measured colour or a profile, so the document speaks of it in more than three numbers.

Summary

A brand's blue is not a blue approximated on a screen: it is a precise pot of ink, ordered from the maker, with a number on it. A printing works lays it down as a separate ink, on top of the usual four, and it comes out the same on every run. A colour can also be described by its real measurement, the one an instrument takes in a laboratory, rather than by a recipe that only means something to a screen.

Technically

Written at the top level of a request, under "color_spaces"

color_spaces declares the colour spaces written into the document, each under the name a colour selects it by. A device colour needs no declaration: three plain numbers are device red, green and blue wherever they appear. A spot ink, a measured space or a profiled one is written into the document before a colour names it. Eight kinds exist — /Separation for a spot ink, /DeviceN, /Indexed, /Lab, /CalRGB, /CalGray, /ICCBased and /Pattern, the space a repeating cell stating no colour of its own is laid down through — each stated by its own numbers, save the ICC space, whose profile arrives as a supplied part.

Request schema

  • color_spaces — array, optional, empty by default.
  • color_spaces[].name — string, required. The name the request's colours select this space by.
  • color_spaces[].space — object, required. Eight kinds:
    • separationcolorant string required; ink array of four numbers optional; transform object optional. Exactly one of the two: both together are refused, neither is refused too.
    • indexedbase required, same recursive shape; entries array of bytes from 0 to 255 required, 256 entries at most.
    • labwhite_point three numbers required; black_point three numbers optional; range four numbers optional, −100 to 100 by default.
    • cal_graywhite_point three numbers required; black_point optional; gamma number optional, 1 by default.
    • cal_rgbwhite_point three numbers required; black_point optional; gamma three numbers optional, 1 by default; primaries three by three numbers optional.
    • iccprofile string required, the name of a supplied part; space optional, otherwise read from the profile.
    • device_ncolorants, an array of the inks' names as the press knows them, required; alternate, the space the tint lands in, and tint, the function turning the tints into a colour in it, taking as many numbers in as there are colorants and as many out as alternate takes, both required; attributes optional, what the inks look like one by one where tint says only what they look like together — colorants, a list of inks each said as a separation is, and process, a space and one components name per component of it.
    • patternbase required, the space the colour the cell is laid down in is stated in, said either by the name of a device space (gray, rgb, cmyk) or in full as a declared space states itself. A pattern space is refused as the base. A colour in it is the numbers the base space takes and the name of the cell, so one cell is laid down in red here and in blue there.
  • transformalternate required, the device space (gray, rgb, cmyk) the numbers the function gives are a colour in; and function required, the function the tint is read through, written under the name of its kind, one number in and as many out as alternate takes. The four kinds and their keys are the ones shadings states: exponential, with low and high required and domain, exponent and range optional, stitching, sampled and calculation.
  • A colour names a declared space through the shape {"space": "the name", "components": n, …}. The short forms stay available: [g] for a grey, [r, g, b], [c, m, y, k], and {"gray": n}.

A whole request that creates a PDF

{
  "color_spaces": [
    {
      "name": "brand_blue",
      "space": {
        "separation": {
          "colorant": "Corporate Blue",
          "ink": [0.92, 0.58, 0.0, 0.06]
        }
      }
    }
  ],
  "items": [
    {
      "type": "rect",
      "rect": { "llx": 60, "lly": 700, "urx": 300, "ury": 780 },
      "fill": { "space": "brand_blue", "components": [1.0] }
    }
  ]
}

The line that sends it, in three languages

Colour and how it is shown

The device the colours are stated for Which plate of a separated sheet a page is The device one page's colours are stated for What a page's bare numbers mean A colour sliding into another Opacity, mixing, and what a press asks for A cell repeated to fill a shape The space a page mixes its colours in

Where to go next

Every JSON key of a request, in one page The other forty-one settings of a request

See the prices See the examples