UNPKG

862 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.updateH = void 0;
4var tslib_1 = require("tslib");
5var hsv2rgb_1 = require("./hsv2rgb");
6var rgb2hex_1 = require("./rgb2hex");
7var _rgbaOrHexString_1 = require("./_rgbaOrHexString");
8/**
9 * Gets a color with the same saturation and value as `color` and the other components updated
10 * to match the given hue.
11 *
12 * Does not modify the original `color` and does not supply a default alpha value.
13 */
14function updateH(color, h) {
15 var _a = hsv2rgb_1.hsv2rgb(h, color.s, color.v), r = _a.r, g = _a.g, b = _a.b;
16 var hex = rgb2hex_1.rgb2hex(r, g, b);
17 return tslib_1.__assign(tslib_1.__assign({}, color), { h: h, r: r, g: g, b: b, hex: hex, str: _rgbaOrHexString_1._rgbaOrHexString(r, g, b, color.a, hex) });
18}
19exports.updateH = updateH;
20//# sourceMappingURL=updateH.js.map
\No newline at end of file