Skip to content

Colour system

Opacity ladder

Eleven alpha steps on the Pogson magnitude scale. Any colour stop can use any step.

Formula

Astronomers measure brightness in magnitudes. The Pogson relation says a difference of five magnitudes is exactly a factor of 100 in flux:

m2−m1=−2.5 log⁡10F2F1m_2 - m_1 = -2.5\,\log_{10}\frac{F_2}{F_1}

so one magnitude is a ratio of 1001/5≈2.512100^{1/5} \approx 2.512. The ladder steps through alpha in half-magnitude increments:

α(n)=10−0.4 n/2\alpha(n) = 10^{-0.4\,n/2}

Ten steps are five magnitudes, so α(10)=10−2=1%\alpha(10) = 10^{-2} = 1\% and the last step is exactly 100 times dimmer than the first. To find the nearest step for an arbitrary alpha, invert the relation:

n=−5 log⁡10αn = -5\,\log_{10}\alpha

The scale

Computed alpha is rounded to two decimals; CSS values are read from globals.css and verified against the formula at build time. The swatch shows deep-space-300 over deep-space-950.
Step nMagnitudeAlpha (computed)Alpha (CSS)TokenSwatch
00.01.00100%--mag-0
10.50.6363.1%--mag-1
21.00.4039.81%--mag-2
31.50.2525.12%--mag-3
42.00.1615.85%--mag-4
52.50.1010%--mag-5
63.00.066.31%--mag-6
73.50.043.98%--mag-7
84.00.032.51%--mag-8
94.50.021.58%--mag-9
105.00.011%--mag-10

Try a stop

Choose any stop to see it at all eleven steps over the deep space background.

bg-deep-space-300/(--mag-3)

Same result as the Tailwind class form shown below the tiles.

Stop by step

The same ladder applied to every stop of one palette. Select a cell to copy its class.

012345678910deep-space-50deep-space-100deep-space-200deep-space-300deep-space-400deep-space-500deep-space-600deep-space-700deep-space-800deep-space-900deep-space-950

Select a cell to copy its Tailwind class.

Rows are stops 50 to 950, columns are --mag-0 to --mag-10, over deep-space-950.

Usage

html
<!-- Tailwind --><div class="bg-deep-space-300/(--mag-3)"></div>
css
/* the equivalent plain CSS */.b {  background: color-mix(in srgb, var(--color-deep-space-300) var(--mag-3), transparent);}
globals.css
@theme static {  --mag-0: 100%;  --mag-1: 63.1%;  --mag-2: 39.81%;  --mag-3: 25.12%;  --mag-4: 15.85%;  --mag-5: 10%;  --mag-6: 6.31%;  --mag-7: 3.98%;  --mag-8: 2.51%;  --mag-9: 1.58%;  --mag-10: 1%;}