Use warm() and cool() for art direction: they move an existing hue toward fixed warm or cool regions while preserving Oklch lightness and chroma. Do not use them when a workflow requires correlated color temperature, white-balance data, or Kelvin values.
Understand the heuristic
The amount controls progress toward the target hue, not a temperature scale. It is clamped to 0..1; negative values behave like zero. Even at 1, the implementation moves halfway toward its target rather than replacing the hue outright.
use PhpColor\Color\Color;
$base = Color::parse('#3b82f6');
echo $base->warm(0.4)->toHex().PHP_EOL;
echo $base->cool(0.4)->toHex().PHP_EOL;
use PhpColor\Color\Color;
$base = Color::parse('#3b82f6');
echo $base->warm(0.4)->toHex().PHP_EOL;
echo $base->cool(0.4)->toHex().PHP_EOL;
The output is:
#816ff1
#0089f2
#816ff1
#0089f2
Both results retain the source's perceptual lightness and chroma before conversion back to sRGB. The visible change depends on the source hue; warm(0.4) is not equivalent to adding a fixed number of degrees.
Choose explicit hue when consistency matters
Use rotateHue() when a system requires a known angular relationship. Use palette harmony tools when several colors must share a geometric pattern. Use warm() and cool() when the intended result is directional and visual rather than numeric.
The heuristic does not guarantee gamut, contrast, or a culturally universal meaning of warm and cool. Verify the delivered colors in context.
Continue with Shift color temperature, Rotate color hue, or ColorInterface for exact method contracts.