Theme
/ API Reference / Color ManipulationTheme
/ API Reference / Color Manipulationrotate
A small utility function that rotates the hue of a CSS color value by a given number of degrees.
It uses the hsl color model to do so.
The Gist
import { rotate } from '@weser/theme'
const rotated = rotate('red', 90)
const rotatedVariable = rotate('var(--background)', -45)
Parameters
| Parameter | Type | Description |
|---|---|---|
| value | string | The CSS color value to rotate the hue of. |
| degrees | number | The number of degrees to rotate the hue by. |
Returns
(string) A string that references a CSS color value with the hue rotated.
© 2024-present Robin Weser. All Rights Reserved.