Skip to main content
Version: Phaser v4.0.0

Types.Display

ColorBandConfig

<static> ColorBandConfig

nametypeoptionaldefaultdescription
colorStartnumber | stringArray.<number>Phaser.Display.ColorYes
colorEndnumber | stringArray.<number>Phaser.Display.ColorYes
startnumberYes0The start point of this band within a ColorRamp. This value should be normalized within the ramp, between 0 (ramp start) and 1 (ramp end).
middlenumberYes0.5The middle point of this band within a ColorRamp. This value should be normalized within the band, between 0 (band start) and 1 (band end). Middle point alters the shape of the color interpolation.
endnumberYes1The end point of this band within a ColorRamp. This value should be normalized within the ramp, between 0 (ramp start) and 1 (ramp end).
sizenumberYesThe size of this band within a ColorRamp. This value should be normalized within the ramp, between 0 (ramp start) and 1 (ramp end). This is used if end is not specified. If being used to construct a ColorRamp, it can also set the start of the next band.
interpolationnumberYes0The color interpolation. This can be one of the following codes: - 0: LINEAR - a straight blend. - 1: CURVED - color changes quickly at start and end, flattening in the middle. Good for convex surfaces. - 2: SINUSOIDAL - color changes quickly in the middle, flattening at start and end. Good for smooth transitions. - 3: CURVE_START - color changes quickly at the start, flattening at the end. - 4: CURVE_END - color changes quickly at the end, flattening at the start. Under the hood, these are similar to the circular easing function.
colorSpacenumberYes0The color space where interpolation should be done. This can be one of the following codes: - 0: RGBA - channels are blended directly. This can be inaccurate. - 1: HSVA_NEAREST - colors are blended in HSVA space, better preserving saturation and lightness. The hue is blended with the shortest angle, e.g. red and blue blend via purple, not green. - 2: HSVA_PLUS - as HSVA_NEAREST, but hue angle always increases. - 3: HSVA_MINUS - as HSVA_NEAREST, but hue angle always decreases.

Type: object

Member of: Phaser.Types.Display

Source: src/display/typedefs/ColorBandConfig.js#L1
Since: 4.0.0


ColorObject

<static> ColorObject

nametypeoptionaldescription
rnumberNoThe red color value in the range 0 to 255.
gnumberNoThe green color value in the range 0 to 255.
bnumberNoThe blue color value in the range 0 to 255.
anumberNoThe alpha color value in the range 0 to 255.
colornumberNoThe combined color value.

Type: object

Member of: Phaser.Types.Display

Source: src/display/typedefs/ColorObject.js#L1
Since: 3.0.0


HSVColorObject

<static> HSVColorObject

nametypeoptionaldescription
hnumberNoThe hue color value. A number between 0 and 1
snumberNoThe saturation color value. A number between 0 and 1
vnumberNoThe lightness color value. A number between 0 and 1

Type: object

Member of: Phaser.Types.Display

Source: src/display/typedefs/HSVColorObject.js#L1
Since: 3.0.0


InputColorObject

<static> InputColorObject

nametypeoptionaldescription
rnumberYesThe red color value in the range 0 to 255.
gnumberYesThe green color value in the range 0 to 255.
bnumberYesThe blue color value in the range 0 to 255.
anumberYesThe alpha color value in the range 0 to 255.

Type: object

Member of: Phaser.Types.Display

Source: src/display/typedefs/InputColorObject.js#L1
Since: 3.0.0