Theme
/ API Reference / Color Manipulation
Theme
/ API Reference / Color Manipulation

hue

A small utility function that sets the hue of a CSS color value to an absolute degree.
It uses the hsl color model to do so.

The Gist

import { hue } from '@weser/theme'

const blueHue = hue('red', 240)
const variableHue = hue('var(--background)', 180)

Parameters

ParameterTypeDescription
valuestringThe CSS color value to set the hue of.
degrees0-360The absolute hue value in degrees.

Returns

(string) A string that references a CSS color value with the hue set to the specified degree.

Import Alias

For convenience, we also export a shorthand import alias.

import { h } from '@weser/theme'
On this page