Derive a light palette from dark tokens

Produce light-mode candidates from an existing named dark palette without changing its keys.

Transform the complete palette so token names remain aligned across modes:

use PhpColor\Color\Palette\ColorPalette;
use PhpColor\Color\Palette\Transformer\LightModeColorPaletteTransformer;

$dark = ColorPalette::parse([
    'background' => '#0b0c0e',
    'text' => '#c0cde7',
    'accent' => '#4f88fc',
]);

$light = (new LightModeColorPaletteTransformer())->transform($dark);

assert([
    'background' => '#dedfe2',
    'text' => '#131c2e',
    'accent' => '#00139d',
] === $light->toHex());
use PhpColor\Color\Palette\ColorPalette; use PhpColor\Color\Palette\Transformer\LightModeColorPaletteTransformer; $dark = ColorPalette::parse([ 'background' => '#0b0c0e', 'text' => '#c0cde7', 'accent' => '#4f88fc', ]); $light = (new LightModeColorPaletteTransformer())->transform($dark); assert([ 'background' => '#dedfe2', 'text' => '#131c2e', 'accent' => '#00139d', ] === $light->toHex());

This creates algorithmic candidates. It does not infer semantic roles or verify contrast between the resulting tokens.

See light-mode palettes or LightModeColorPaletteTransformer.