Compute and manipulate modular scales: typography, rhythm, grids.

ALTO Scale computes mathematical progressions for typography, spacing, grids, and other design values. Every scale can return a step, find the nearest step, snap an arbitrary value, and generate a range.

<?php
use Alto\Scale\Scale;

$type = Scale::majorThird(16);

$type->get(-1);       // 12.8
$type->get(0);        // 16.0
$type->get(1);        // 20.0
Scale::majorThird(16)->snap(19.8); // 20.0

Introduction

Scales

  • All scales: choose a progression for the values you need.
  • Modular: generate a geometric progression from a base and ratio.
  • Linear: generate values separated by a constant increment.
  • Fibonacci: generate a scaled Fibonacci sequence.
  • Multi-strand: interleave several modular progressions.

Analysis

  • Guessing: infer a modular scale from existing positive values.
  • Linting: audit values and align them to a scale.