UNPKG

@itwin/core-common

Version:

iTwin.js components common to frontend and backend

39 lines 1.34 kB
"use strict"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ /** @packageDocumentation * @module Symbology */ Object.defineProperty(exports, "__esModule", { value: true }); exports.HSLColor = void 0; const ColorDef_1 = require("./ColorDef"); /** An immutable color defined by Hue, Saturation, and Lightness. * @see [here](https://en.wikipedia.org/wiki/HSL_and_HSV) for difference between HSL and HSV * @public */ class HSLColor { /** Hue */ h; /** Saturation */ s; /** Lightness */ l; constructor(hue = 0, saturation = 0, lightness = 0) { this.h = hue; this.s = saturation; this.l = lightness; } clone(hue, saturation, lightness) { return new HSLColor(hue ?? this.h, saturation ?? this.s, lightness ?? this.l); } toColorDef(transparency = 0) { return ColorDef_1.ColorDef.fromHSL(this.h, this.s, this.l, transparency); } static fromColorDef(val) { return val.toHSL(); } } exports.HSLColor = HSLColor; //# sourceMappingURL=HSLColor.js.map