import { float_to_uint8 } from "../../binary/float_to_uint8.js";
import { hsv2rgb_float } from "./hsv2rgb_float.js";

/**
 *
 * @param {number} h from 0 to 1
 * @param {number} s from 0 to 1
 * @param {number} v from 0 to 1
 * @returns {{r: number, g: number, b: number}} output in range 0..255
 */
export function hsv2rgb(h, s, v) {

    const {r,g,b} = hsv2rgb_float(h,s,v);

    return {
        r: float_to_uint8(r),
        g: float_to_uint8(g),
        b: float_to_uint8(b)
    };
}

