import { MAX_COLOR_ALPHA } from './consts.js';
import { hsv2rgb } from './hsv2rgb.js';
import { hsv2hex } from './hsv2hex.js';
import { _rgbaOrHexString } from './_rgbaOrHexString.js';

function getColorFromHSV(hsv, a) {
  var h = hsv.h, s = hsv.s, v = hsv.v;
  a = typeof a === "number" ? a : MAX_COLOR_ALPHA;
  var _a = hsv2rgb(h, s, v), r = _a.r, g = _a.g, b = _a.b;
  var hex = hsv2hex(h, s, v);
  var str = _rgbaOrHexString(r, g, b, a, hex);
  return { a: a, b: b, g: g, h: h, hex: hex, r: r, s: s, str: str, v: v };
}

export { getColorFromHSV };
