2,300 years of math. One CLI.
The math accumulates.
The Ratio
Divide a line so the whole-to-large ratio equals the large-to-small. The number 1.618 falls out. Pure geometry, no aesthetics — yet it would define beauty for millennia.
"A straight line is said to have been cut in extreme and mean ratio when the whole line is to the greater segment as the greater is to the lesser."
dk scale --ratio=goldenThe Divine
Pacioli called it divine. Da Vinci drew the illustrations. They elevated a geometric ratio into an aesthetic principle — the claim that mathematics IS beauty.
dk scale --ratio=golden --base=16The New Typography
After visiting the Bauhaus in 1923, Tschichold codified modernist typography: sans-serif, asymmetric layouts, mathematical grids. The idea that layout should follow systematic rules, not intuition.
"The essence of the new typography is clarity."
dk audit --css=layout.cssThe Modulor
A complete proportional system from one number: 1.618 times the human body. Room heights, window widths, stair treads — all derived from a single ratio. The direct ancestor of what dk does.
"A range of harmonious measurements to suit the human scale, universally applicable to architecture and to mechanical things."
dk scale --ratio=golden --base=183Perceptual Color
The first attempt at perceptually uniform color. The radical idea: color math should match human perception, not display physics. Equal numeric steps should look like equal visual steps.
dk palette "#3b82f6"The Grid
The bible. Every spacing value, every margin, every column width derived from a base module. Not decoration — structure. The grid is the skeleton that makes visual harmony inevitable.
"The grid system is an aid, not a guarantee. It permits a number of possible uses and each designer can look for a solution appropriate to his personal style."
dk audit --css=grid.cssThe Modular Scale
Defined the modular scale for typography: a prearranged set of harmonious proportions, like a musical scale. Major third (1.25), perfect fourth (1.333), perfect fifth (1.5) — musical intervals as type sizes.
"A modular scale, like a musical scale, is a prearranged set of harmonious proportions."
dk scale --ratio=major-third --base=16The Web Scale
Took Bringhurst's idea and made it practical for screens. Created modularscale.com. His talk at Build 2010 is the direct inspiration for every modular scale tool that followed — including dk.
dk scale --ratio=perfect-fourth --fluidPerceptual Color, Solved
A game developer who wanted to "just make a color darker" and found every existing color space broken. Oklab is now the default in Photoshop, CSS, and every modern browser. The math inside dk's palette generator.
"I wanted to find a better balance. Something Lab-like, but okay."
dk palette "#3b82f6" --harmony=triadicContrast, Corrected
Replaced the simple luminance ratio with a polarity-aware power-curve model. Dark text on light background behaves differently than light on dark. Font size and weight matter. Heading into WCAG 3.0.
dk contrast "#fff" "#2563eb" --size=16One CLI
Euclid's ratio. Le Corbusier's Modulor. Bringhurst's scale. Ottosson's color. Somers' contrast. Muller-Brockmann's grid. All of it, from first principles, zero dependencies, in a single command.
dk audit --css=your-app.cssMathematics doesn't expire.
Use the tools