import '../../../assert/js/assert.js';
import '../../../globals.js';
// Copyright 2020-2024, University of Colorado Boulder
/**
 * Invert filter
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import toSVGNumber from '../../../dot/js/toSVGNumber.js';
import { Filter, scenery } from '../imports.js';
class Invert extends Filter {
    /**
     * @param [amount] - The amount of the effect, from 0 (none) to 1 (full)
     */
    constructor(amount = 1) {
        assert && assert(isFinite(amount), 'Invert amount should be finite');
        assert && assert(amount >= 0, 'Invert amount should be non-negative');
        assert && assert(amount <= 1, 'Invert amount should be no greater than 1');
        super();
        this.amount = amount;
    }
    /**
     * Returns the CSS-style filter substring specific to this single filter, e.g. `grayscale(1)`. This should be used for
     * both DOM elements (https://developer.mozilla.org/en-US/docs/Web/CSS/filter) and when supported, Canvas
     * (https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter).
     */
    getCSSFilterString() {
        return `invert(${toSVGNumber(this.amount)})`;
    }
    isDOMCompatible() {
        return true;
    }
    applyCanvasFilter(wrapper) {
        throw new Error('unimplemented');
    }
    applySVGFilter(svgFilter, inName, resultName) {
        throw new Error('unimplemented');
    }
}
Invert.FULL = new Invert(1);
export default Invert;
scenery.register('Invert', Invert);
//# sourceMappingURL=Invert.js.map