Optionalconfig: ColorBandConfig
The configuration to use for the band.
The color at the end of the color band.
The color space where interpolation should be done. This can be one of the following codes:
The color at the start of the color band.
The end point of this band within a ColorRamp. This value should be normalized within the ramp, between 0 (ramp start) and 1 (ramp end).
The color interpolation. This can be one of the following codes:
Modes 2, 3, and 4 use the circular easing function directly. Mode 1 uses a related custom formula based on the unit circle.
ReadonlyisIdentifies this object as a ColorBand. This property is read-only and must not be modified.
The 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.
Mathematically, the gradient should be 0.5 at the middle.
We use a gamma curve to adjust the gradient.
Thus, 0.5 = middle^gamma.
By the properties of logarithms, therefore,
gamma = log base middle of 0.5.
The start point of this band within a ColorRamp. This value should be normalized within the ramp, between 0 (ramp start) and 1 (ramp end).
Returns the blended color at a normalized position within this band.
The middle point gamma curve, interpolation mode, and color space are
all applied before blending between colorStart and colorEnd.
The normalized position within the band, where 0 is the band start and 1 is the band end.
The blended color at that position.
Set the colors of the band, from a variety of color formats.
This ColorBand.
The ColorBand class represents a transition from one color to another. It is used in a {@see Phaser.Display.ColorRamp}, and forms the basis of a {@see Phaser.GameObjects.Gradient}.
ColorBand can control the transition by setting a middle point, a color space for blending, and an interpolation style.
This class also records
startandendpoints for use in a ramp. These indicate its position within the ramp.Colors are handled unpremultiplied, so RGB values may be larger than alpha.