At least one step
One step returns only the source. With more than one, ratios run evenly from zero through one and include black.
Turn one color into a complete, ordered collection of mixes toward black.
0
#806eae
0.25
#554975
0.5
#2e2641
0.75
#0b0813
1
#000000
With more than one step, the collection starts with the source and ends at black. Every intermediate color is an evenly spaced Oklab mix.
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');
$shades = ColorPalette::shades($source, 5);
print_r($shades->toHex());
// #806eae #554975 #2e2641 #0b0813 #000000
use PhpColor\Color\Color;
use PhpColor\Color\Palette\ColorPalette;
$source = Color::parse('#806eae');
$shades = ColorPalette::shades($source, 5);
print_r($shades->toHex());
// #806eae #554975 #2e2641 #0b0813 #000000
shade() mixes the complete color toward black in Oklab. darken() changes only the OKLCH lightness coordinate. A shade collection is also not a dark-mode palette.
One step returns only the source. With more than one, ratios run evenly from zero through one and include black.
Shades do not guarantee foreground contrast, assign token roles, or derive an accessible dark theme. A translucent source also mixes its alpha toward opaque black.