@itwin/core-common
Version:
iTwin.js components common to frontend and backend
43 lines • 2.21 kB
JavaScript
;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module DisplayStyles
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.WhiteOnWhiteReversalSettings = void 0;
/** As part of a [[DisplayStyleSettings]], controls how white-on-white reversal is applied to make white geometry more
* visible in the view.
* By default, pure white geometry is displayed as black instead if the [[DisplayStyleSettings.backgroundColor]] is also pure white.
* These settings are only applied if the display style's [[ViewFlags.whiteOnWhiteReversal]] flag is enabled.
* @see [[DisplayStyleSettings.whiteOnWhiteReversal]] to change these settings for a display style.
* @public
*/
class WhiteOnWhiteReversalSettings {
/** If true, white-on-white reversal ignores the display style's background color; otherwise, white-on-white reversal applies only
* if the background color is pure white.
* @see [[DisplayStyleSettings.backgroundColor]] to change the background color.
*/
ignoreBackgroundColor;
constructor(ignoreBackground) {
this.ignoreBackgroundColor = ignoreBackground;
}
static _noIgnore = new WhiteOnWhiteReversalSettings(true);
static _ignore = new WhiteOnWhiteReversalSettings(false);
/** Create from JSON representation. */
static fromJSON(props) {
return props?.ignoreBackgroundColor ? this._noIgnore : this._ignore;
}
/** Convert to JSON representation. The JSON representation is `undefined` if these settings match the defaults. */
toJSON() {
return this.ignoreBackgroundColor ? { ignoreBackgroundColor: true } : undefined;
}
/** Returns true if `this` is equivalent to `other`. */
equals(other) {
return this === other;
}
}
exports.WhiteOnWhiteReversalSettings = WhiteOnWhiteReversalSettings;
//# sourceMappingURL=WhiteOnWhiteReversalSettings.js.map