Build color tints

Turn one color into a complete, ordered collection of mixes toward white.

0
#806eae
0.25
#9e91c3
0.5
#bdb5d7
0.75
#dddaeb
1
#ffffff
SourceOklab mixes toward whiteWhite

Include both ends of the tint sequence

With more than one step, the collection starts with the source and ends at white. Every intermediate color is an evenly spaced Oklab mix.

Generate every tint together

Choose the source and number of steps. PHPColor returns an ordered palette while leaving the source color unchanged.

<?php

use PhpColor\Color\Color;
use PhpColor\Color\Palette\ColorPalette;

$source = Color::parse('#806eae');
$tints = ColorPalette::tints($source, 5);

print_r($tints->toHex());
// #806eae #9e91c3 #bdb5d7 #dddaeb #ffffff
use PhpColor\Color\Color; use PhpColor\Color\Palette\ColorPalette; $source = Color::parse('#806eae'); $tints = ColorPalette::tints($source, 5); print_r($tints->toHex()); // #806eae #9e91c3 #bdb5d7 #dddaeb #ffffff

Tinting is not lightness adjustment

tint() mixes the complete color toward white in Oklab. lighten() changes only the OKLCH lightness coordinate, so the operations do not produce interchangeable sequences.

At least one step

One step returns only the source. With more than one, ratios run evenly from zero through one and include white.

No semantic guarantee

Tints do not assign token names, guarantee contrast, or guarantee target-gamut output. A translucent source also mixes its alpha toward opaque white.

Continue the sequence

Compare Oklab tints with their matching shades