UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

27 lines 1 kB
define(["require", "exports", "./hsv2rgb", "./rgb2hex", "./_rgbaOrHexString"], function (require, exports, hsv2rgb_1, rgb2hex_1, _rgbaOrHexString_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Gets a color with the same hue as `color` and other components updated to match the given * saturation and value. * * Does not modify the original `color` and does not supply a default alpha value. */ function updateSV(color, s, v) { var _a = hsv2rgb_1.hsv2rgb(color.h, s, v), r = _a.r, g = _a.g, b = _a.b; var hex = rgb2hex_1.rgb2hex(r, g, b); return { a: color.a, b: b, g: g, h: color.h, hex: hex, r: r, s: s, str: _rgbaOrHexString_1._rgbaOrHexString(r, g, b, color.a, hex), v: v }; } exports.updateSV = updateSV; }); //# sourceMappingURL=updateSV.js.map