@pbroom/color-kitConversion

fromHsv

Convert HSV/HSB (hue in degrees, saturation and value 0-100) to a Color.

functionimport { fromHsv } from '@pbroom/color-kit';index.ts:299
function fromHsv(hsv: Hsv): Color;

The intermediate sRGB value is not quantized to 8-bit, so fractional HSV inputs keep full precision. Any finite hue is accepted and wrapped.

Parameters

hsvHsv
HSV color

Returns

ColorA new OKLCH Color

Example

TypeScript
import { fromHsv, toHex } from '@pbroom/color-kit';

toHex(fromHsv({ h: 30, s: 100, v: 100, alpha: 1 })); // → '#ff8000'

See also