Overlaps Mixed in Linear Light

A logo has two half-transparent circles that overlap, and the overlap comes out a muddy olive in one program and a clear yellow in another. Nothing is wrong with the colours: each program mixed them its own way, in the numbers as written or as light really adds up, and the file never said which.

This page says it. Every page of the document is marked as mixing its colours in a calibrated RGB in linear light, and as starting from nothing rather than from whatever lies under it once the page is placed on another. Beside each pair of discs, two squares show the colour the overlap takes when the request is honoured and the colour it takes when a program ignores it, so whoever opens the file sees at a glance which one their software does.

The request is one setting for the whole document, and each disc keeps its own opacity. It decides only how overlapping colours are mixed: a page with no transparency looks the same with it or without it.

What This Example Shows

  • Two pairs of overlapping discs, the second of each at half opacity.
  • Beside each pair, the overlap as it should be and as a program that ignores the request shows it.
  • One setting asks every page of the document to mix its colours in linear light.

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.

Read the Rust source Read the Python 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

Overlaps Mixed in Linear Light, first page

The Same Document in Other Languages

This document weighs 15.2 kB

Examples Near This One

Cutting out What You Draw

The same area of stripes shown through two windows: a plain disc, and a ring whose middle is left bare.

Transparency and Blend Modes

Half-transparent fills that overlap and mix, one orange square laid over a blue bar in four different ways of mixing colours, and a line of overlapping letters painted two ways.

Gradients in a Line, in a Circle, and Read from a Function

Five panels: a header that fades out, the same fade on the diagonal, a glow carried past its own circle so the corners fill, a blend that goes by way of a third colour, and a checkerboard whose colour is worked out from where each point stands, redder to the right and greener towards the top.

Text and Shapes Filled with a Gradient

A gradient used as the colour something is filled with: a headline whose letters are windows onto a blend of three colours, a panel filled with a circular one that lets the page show through, and a band whose blend is stood upright and whose border is painted with the circular one.

Four Kinds of Mesh, Every Corner Its Own Colour

Six triangles round a centre they share, their edges stroked over the paint; a lattice of points in the four printing inks; a patch whose four sides are curves; and the same patch pulled about by four points inside it.

Every example, by subject