Skip to content

ShadedRectangle

Overview

A rectangle with pseudo-3D shading.

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

Class ShadedRectangle

import { ShadedRectangle } from 'scenerystack/scenery-phet';

Constructor

new ShadedRectangle( rectBounds : Bounds2, providedOptions? : ShadedRectangleOptions )

Instance Methods

dispose()

Type ShadedRectangleOptions

import type { ShadedRectangleOptions } from 'scenerystack/scenery-phet';
  • baseColor?: TColor
  • lightFactor?: number
  • lighterFactor?: number
  • darkFactor?: number
  • darkerFactor?: number
  • cornerRadius?: number
  • lightSource?: LightSource
  • lightOffset?: number
    What fraction of the cornerRadius should the light and dark gradients extend into the rectangle? Should always be less than 1.
  • darkOffset?: number
  • & NodeOptions

Source Code

See the source for ShadedRectangle.ts in the scenery-phet repository.