#3783ad
Rotate color hue
Move one color by an explicit angle around the OKLCH hue circle and inspect the exact result.
#806eae
#a8617c
Move by an explicit signed angle
Hue rotates by -60 or +60 degrees and wraps around one turn. Native lightness, chroma, and alpha remain fixed before conversion back to SrgbColor.
Rotate forward or backward
rotateHue() accepts positive or negative degrees, normalizes the result, returns the receiver's concrete class, and leaves the source unchanged.
<?php
use PhpColor\Color\Color;
$source = Color::parse('#806eae');
$backward = $source->rotateHue(-60);
$forward = $source->rotateHue(60);
echo $backward->toHex(); // #3783ad
echo $source->toHex(); // #806eae
echo $forward->toHex(); // #a8617c
use PhpColor\Color\Color;
$source = Color::parse('#806eae');
$backward = $source->rotateHue(-60);
$forward = $source->rotateHue(60);
echo $backward->toHex(); // #3783ad
echo $source->toHex(); // #806eae
echo $forward->toHex(); // #a8617c
Rotation is not harmony generation
Hue rotation derives one color at one explicit offset. A harmony generates a named multi-color relationship, while palette repair aligns an existing collection.
Evaluate the rotated color in context
Hue rotation does not choose or validate a harmony, guarantee target-gamut membership, or judge design suitability.
Hue is not visually meaningful for an achromatic color. Conversion noise can still produce an arbitrary reported angle.
Hexadecimal serialization quantizes the native channels.