Skip to content

Grayscale

Overview

Grayscale filter

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class Grayscale

import { Grayscale } from 'scenerystack/scenery';

Constructor

new Grayscale( amount )

Instance Methods

getCSSFilterString() : string

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).

isDOMCompatible() : boolean

Static Properties

FULL : Grayscale

(readonly)

Turns things fully gray-scale (instead of partially)

Source Code

See the source for Grayscale.ts in the scenery repository.