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.0Introduction
- Installation: install the package and verify the runtime.
- Getting started: create and use a first scale.
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.