Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Palettes

A palette is a list of colour stops plus two more colours: the background, for empty cells, and the stage, for the area outside the tiling. Each automaton in a scene has its own palette, and the rule decides how its states and ages are spread along the stops. JETCARP has 30 built-in palettes; jetcarp palettes lists them, and jetcarp palettes --json gives the same list as data. For choosing and editing palettes in the app, see Palettes and colouring.

The built-in palettes

Generated from jetcarp palettes --json (JETCARP 0.4.0). The bar is each palette's ramp, drawn as JETCARP interpolates it: in a straight line between neighbouring stops, on the palette's own background.

Candy, Glacier, Desert and Paper have light backgrounds; the rest are dark. Stained Glass and Opal are closed colour wheels whose last stop repeats the first, so the cyclic automaton and rock-paper-scissors, which colour states around the whole palette, show no seam. Some palettes, such as Verdigris, end on a bright stop, so a pattern that has settled stays vivid under age colouring.

PaletteColours, young or low to old or high, on its backgroundStopsBackgroundStage
Ember#ffd27a #ff8a3c #d6336c #6a2c91 #2b2d6e#1d2029#101217
Tide#e8fff7 #58e0c2 #1f9fc9 #2a5bb8 #2b2470#1d2029#101217
Prism#ff4d4d #ffb02e #e8e337 #3ddc6d #2fb6ff #8a5cff #ff4dc4#1d2029#101217
Ink#7fd0ff #7fd0ff #5a9bd0 #3d6a99 #2a4766#1d2029#101217
Mono#f2f2f2 #c8c8c8 #8c8c8c #5a5a5a#1d2029#101217
Aurora#c8ffe8 #4dffb0 #27d3c3 #4f7bff #9c5cff #7a3fc4#0a0f24#05081a
Synthwave#ff71ce #c77dff #3fd0ff #2fe8b0 #fff59a#1b0b30#0e0619
Moss#f0f7b8 #b5dc5e #6faa3e #468a3c #3b7046#141a11#0a0d09
Candy (light)#e0407a #f07fae #a77fe0 #5fb0e8 #4cbf98#fff6e8#f0e2cc
Lava#fff4c0 #ffc23e #ff6a1a #d8261c #9c1424 #6e1022#140806#0a0403
Glacier (light)#05305e #15599a #2f86c4 #5aa7d8 #82bde0#edf5fa#d5e4ee
Phosphor#e0ffe0 #6dff6d #33d040 #23a032 #1a7a28#030d06#010603
Koi#ffffff #ffd2a8 #ff8a33 #e0412b #b3262d#0d2a33#071a20
Desert (light)#4a1f0e #8a3c18 #c0632a #d58a48 #c79a68#f4e4c6#e6d1aa
Thermal#ffffff #fff05a #ff9a1a #e8203c #a01c9c #4a22c8#07000f#030008
Deep Sea#a8fbff #3ad8ea #1a92d2 #1d62b0 #2a4a90 #343c88#020c19#01060d
Paper (light)#111418 #2b3a58 #4b5b7c #6f7e9a #8e98ac#f6f2e9#e7e0d1
Blueprint#ffffff #dcefff #aed3fa #80b5ec #5f9be0#0f3b70#092a52
Neon#fffb7a #39ff14 #00f0ff #ff2fd0 #ff5a1f#070707#000000
Autumn#ff5236 #ffa83c #d9792c #ae4a2c #8c6431#1b130d#0e0a06
Verdigris#fff1c9 #f2b366 #c7743c #3fa796 #7fe0c8#10201f#081211
Marigold#ffffff #ffe27a #ffb81c #f08a00 #ffc94d#14213d#0b1426
Coral#fff0e6 #ff9e80 #ff5e62 #2ec4b6 #9bf6e3#102a43#081a2c
Orchid#fff0ff #f4a6ff #d05cff #7a6cff #b8b4ff#170f2e#0d081c
Citrus#ffffd6 #e9ff70 #a7e33b #ffa62b #ffd166#2a1235#180a1f
Riso#ff3d7f #ff6b9d #3a56d4 #1f3bb3 #14257f#f7f1e1#e9e0c9
Bone#ff5a36 #f2c14e #e8dcc0 #f5eedc #fffaf0#15130f#0b0a08
Ultramarine#ffffff #9bd1ff #4aa3ff #2f6bff #6f8cff#05071a#02030c
Stained Glass#e63946 #f4a261 #f1d54b #2a9d8f #3a86ff #9b5de5 #e63946#0d0d12#060608
Opal#ffb3c6 #ffd6a5 #fdffb6 #b9fbc0 #a0c4ff #cdb4ff #ffb3c6#1b1d2b#10111a

Choosing a palette

  • In a scene, each automaton’s palette field names its palette (see the scene file format). A JACA automaton has a second one, palette_neg, for its −1 cells. The defaults are Ember, and for JACA Tide (+1) and Ember (−1).
  • On the command line, commands that draw pictures, such as jetcarp wallpaper, jetcarp hashlife, jetcarp sheet and jetcarp search pile, take --palette NAME.
  • Your own colours. Wherever a palette name is accepted you can also write colours: #4fc3ff is one colour, and #103050-#4fc3ff a ramp from the first to the last. Stops are separated by -, commas or spaces, young or low first, as three- or six-digit hex. A scene can also carry named palettes of its own in its palettes list, each with its stops and, optionally, its own background and stage; the app saves the palettes you make there.

Names are matched exactly, capitals included: the scene’s own palettes first, then the built-in ones, then hex colours. A name you type that matches none of them (ember, say), in a --palette option, a command or a script, is refused with the list of names. A scene file that names one still loads, so that a scene saved by a later JETCARP with newer palettes opens: the name is kept (saving the scene keeps it), that automaton is drawn in Ember, and jetcarp run, jetcarp verify and the app’s status line say so (“palette ‘Dusk’ is unknown here; drawn in Ember”).

How a palette colours cells

Every automaton has a colour by setting (color_by in a scene):

SettingWhat it shows
auto (the default)The rule’s natural choice, in the table below
ageHow long each cell has been in its state (see Age colouring)
stateOne colour per state: state 0 is the background and states 1 and up are spread evenly from the first stop to the last
rowEach live cell by its height in the picture, top to bottom, across the whole palette

Sandpiles are always coloured by height, and continuous fields (Lenia) by value, unless coloured by row. With auto, each family is coloured like this:

FamilyColours
Life-like, Generations, Larger than Life, priority tables, Margolus, and the two-state row and layered rulesBy age. Row and layered rules write each cell once, so their cells keep the first stop
JACA+1 cells by age from palette, −1 cells by age from palette_neg; destroyed cells glow pale yellow over the background and fade (glow, on by default; drawing only, not part of the state)
Generations’ dying states, and states above 1 of other multi-state rules coloured by ageBy state, between 45% and 95% of the way along the palette
Cyclic automaton, rock-paper-scissorsEvery state, 0 included, at an even step around the palette
HodgepodgeEvery state from 0 at the first stop to the highest at the last
Greenberg–HastingsResting cells are background, excited cells the first stop, refractory stages from about a third of the way along towards the end
Ants and turmitesColour 0 is background, colours 1 and up spread from the first stop; the ants themselves are drawn on top in a fixed pink-red (#ff3b6b)
Three-state hexagon rules, rule tablesState 0 is background, states 1 and up spread from the first stop to the last
Spectre gliderStates 1, 2 and 3 at the start, 80% and 50% of the way along
SandpileHeight 0 is background; heights 1 up to one below the tile’s threshold are spread from the first stop; a tile still at or above its threshold shows the last stop
LeniaEmpty cells are background; low values take the last stop and a value of 1 the first
WireWorldFixed colours: electron heads blue, tails red, wire amber
Forest fireFixed colours: trees green, fire orange
Von Neumann’s 29 statesA fixed colour for each state (see Von Neumann’s automaton)

Several automata

Each field is coloured by the first automaton in the scene’s list that uses it, and fields are drawn in order, later ones over earlier ones, with ants on top. Empty cells take the background of the palette of the first automaton on the bottom field, and the area outside the tiling takes its stage colour; tile outlines are a shade of that background. See Several automata at once.

Age colouring

Each live cell carries an age: the number of generations it has been in its current state, starting at 1 when it is born or changes state (the count stops at about 65,000). Under age colouring a newborn cell takes the first stop, and older cells move along the palette on a logarithmic scale, reaching the last stop at an age of 400. A still life therefore ends at the last stop, an oscillator flickers near the start, and the debris of an old soup shows its history: recently active regions at the young end, settled ones at the old end. Every stop of the built-in palettes is chosen to contrast with the palette’s background, since any of them can end up next to an empty cell.

The ages are part of the world’s state hash (see Reproducibility). HashLife jumps keep the cells but not their ages: after a jump every live cell has age 1.

JETCARP makes no claim for age colouring: Chris Rowett’s LifeViewer and other programs colour cells by age, and fade cells that die, and did so first (see What is new in JETCARP).