# color

Color-format conversion and variation helpers for hex / RGB workflows.

[`hexToRgb`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/color/#api-hexToRgb) parses a hex string into an [`Rgb`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/color/#api-Rgb) shape; [`rgbToHex`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/color/#api-rgbToHex) and [`rgbStringToHex`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/color/#api-rgbStringToHex) go the other way. [`rgbToString`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/color/#api-rgbToString) formats an [`Rgb`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/color/#api-Rgb) for use in CSS color properties. [`getColorVariation`](https://www.hyperfrontend.dev/docs/libraries/utils/ui/color/#api-getColorVariation) produces a lightened or darkened shade of an input color: useful for hover/active states, theme generation, or any case where you want a derived color without committing to a full palette.

---

Canonical page: https://www.hyperfrontend.dev/docs/libraries/utils/ui/color/
This file: https://www.hyperfrontend.dev/docs/libraries/utils/ui/color.md
Documentation index: https://www.hyperfrontend.dev/llms.txt
