effects
hueRotate
Applies a filter: hue-rotate(...), rotating every pixel's hue by the given angle while preserving lightness and saturation, so one source asset can be retinted per theme.
import { hueRotate } from "@sdxc/u/effects";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.hueRotate() | css({ "--ui-filter-hue-rotate": "90deg", filter: "... hue-rotate(var(--ui-filter-hue-rotate, 0deg)) ..." }) |
u.hueRotate("0.5turn") | css({ "--ui-filter-hue-rotate": "0.5turn", filter: "... hue-rotate(var(--ui-filter-hue-rotate, 0deg)) ..." }) |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.hueRotate()Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.hueRotate())Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.hueRotate())Customizing the theme
The custom properties this utility reads, which a theme redefines.
| Variable |
|---|
--ui-filter-hue-rotate |
Signature
u.hueRotate(value?: AngleValue)