Phaser API Documentation

  Version: 
<static> ColorSpectrum([limit])

Description:

Return an array of Colors in a Color Spectrum.

The spectrum colors flow in the order: red, yellow, green, blue.

By default this function will return an array with 1024 elements in.

However, you can reduce this to a smaller quantity if needed, by specitying the limit parameter.

Parameters:

name type arguments Default description
limit number <optional> 1024

How many colors should be returned? The maximum is 1024 but you can set a smaller quantity if required.

Returns:
Description:

An array containing limit parameter number of elements, where each contains a Color Object.

Since: 3.50.0