Optionalred: number
The red color value. A number between 0 and 1. Default 0.
Optionalgreen: number
The green color value. A number between 0 and 1. Default 0.
Optionalblue: number
The blue color value. A number between 0 and 1. Default 0.
The blue color value. Between 0 and 1.
Changing this property will flag this RGB object as being dirty
and invoke the onChangeCallback, if set.
Is this color dirty?
The green color value. Between 0 and 1.
Changing this property will flag this RGB object as being dirty
and invoke the onChangeCallback, if set.
This callback will be invoked each time one of the RGB color values change.
The callback receives the red, green, and blue values as three separate numeric arguments, each in the range 0 to 1.
The red color value. Between 0 and 1.
Changing this property will flag this RGB object as being dirty
and invoke the onChangeCallback, if set.
Destroys this RGB instance by nulling the onChangeCallback reference,
releasing any external listener held by this object.
Compares the given rgb parameters with those in this object and returns
a boolean true value if they are equal, otherwise it returns false.
The red value to compare with this object.
The green value to compare with this object.
The blue value to compare with this object.
true if the given values match those in this object, otherwise false.
Internal on change handler. Sets this object as being dirty and
then invokes the onChangeCallback, if set, passing in the
new RGB values.
Sets the red, green and blue values of this RGB object, flags it as being
dirty and then invokes the onChangeCallback, if set.
Optionalred: number
The red color value. A number between 0 and 1. Default 0.
Optionalgreen: number
The green color value. A number between 0 and 1. Default 0.
Optionalblue: number
The blue color value. A number between 0 and 1. Default 0.
This RGB instance.
The RGB class holds a single color value expressed as normalized red, green, and blue components, each in the range 0 to 1. It is used internally by WebGL pipelines and other Phaser systems that need to track color state efficiently. Changes to any component automatically set the
dirtyflag and invoke an optionalonChangeCallback, making it straightforward to react to color mutations without manual polling.