Rotate color hue

Move one color by an explicit angle around the OKLCH hue circle and inspect the exact result.

Two rotations around an OKLCH hue circle Source hex 806eae at 296.154 degrees rotates backward to hex 3783ad at 236.154 degrees and forward to hex a8617c at 356.154 degrees.
Rotate -60 deg H 236.154 #3783ad
Source H 296.154 #806eae
Rotate +60 deg H 356.154 #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.

One sourceThe receiver stays unchanged.
One anglePositive or negative degrees.
One resultNo palette is generated.
One turnThe final angle is normalized.

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.

Choose a next step

Rotate one color or generate a complete relationship