Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ColorCache

Use ColorCache to reuse a color specified by name and save allocation as well as setup time.

Implemented as a singleton. Do not modify colors after getting them from the ColorCache.

Hierarchy

  • ColorCache

Index

Accessors

Methods

Accessors

size

  • get size(): number

Static instance

Methods

clear

  • clear(): void
  • Clears the cache. Only references to the THREE.Color are removed from the cache. Consequently, clearing the cache does not cause any negative visual impact.

    Returns void

getColor

  • getColor(colorCode: string | number): Color
  • Returns the color for the given colorCode. This function may reuse a previously generated color, so you cannot modify the contents of the color.

    Parameters

    • colorCode: string | number

      ThreeJS color code or name. You must provide a valid color code or name, as this function does not do any validation.

    Returns Color

Generated using TypeDoc