phaser - v4.0.0-rc.4
    Preparing search index...

    The RGB class holds a single color value and allows for easy modification and reading of it, with optional on-change callback notification and a dirty flag.

    Index

    Constructors

    • Parameters

      • 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.

      Returns RGB

    Properties

    b: number

    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.

    dirty: boolean

    Is this color dirty?

    g: number

    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.

    onChangeCallback: Function

    This callback will be invoked each time one of the RGB color values change.

    The callback is sent the new color values as the parameters.

    r: number

    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.

    Methods

    • Nulls any external references this object contains.

      Returns void

    • Compares the given rgb parameters with those in this object and returns a boolean true value if they are equal, otherwise it returns false.

      Parameters

      • red: number

        The red value to compare with this object.

      • green: number

        The green value to compare with this object.

      • blue: number

        The blue value to compare with this object.

      Returns boolean

    • Internal on change handler. Sets this object as being dirty and then invokes the onChangeCallback, if set, passing in the new RGB values.

      Returns void

    • Sets the red, green and blue values of this RGB object, flags it as being dirty and then invokes the onChangeCallback, if set.

      Parameters

      • 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.

      Returns this