three-nebula API
    Preparing search index...

    Class Color

    A behaviour which mutates the color of a particle over time.

    Hierarchy (View Summary)

    Index
    • Constructs a Color behaviour instance.

      Parameters

      • OptionalcolorA: string

        the starting color

      • OptionalcolorB: string

        the ending color

      • Optionallife: number

        the life of the particle

      • Optionaleasing: EasingFunction

        The behaviour's decaying trend

      • isEnabled: boolean = true

        Determines if the behaviour will be applied or not

      Returns Color

    _life: number
    _same: boolean
    age: number
    colorA: ColorSpan
    colorB: ColorSpan
    dead: boolean
    energy: number
    id: string
    isEnabled: boolean
    type: string
    • get life(): number

      Gets the behaviour's life.

      Returns number

    • set life(life: number): void

      Ensures that life is infinity if an invalid value is supplied.

      Parameters

      • life: number

      Returns void

    • get same(): boolean

      Gets the _same property which determines if the alpha are the same.

      Returns boolean

    • set same(same: boolean): void

      Sets the _same property which determines if the alpha are the same.

      Parameters

      • same: boolean

      Returns void

    • Compares the age of the behaviour vs integration time and determines if the behaviour should be set to dead or not.

      Parameters

      • particle: Particle
      • time: number
      • Optionalindex: number

      Returns void

    • Returns a new instance of the behaviour from the JSON object passed.

      Parameters

      • json: Record<string, unknown>

      Returns void

    • Reset this behaviour's parameters.

      Parameters

      • OptionalcolorA: string
      • OptionalcolorB: string
      • Optionallife: number
      • Optionaleasing: EasingFunction

      Returns void

    • Creates a Color initializer from JSON.

      Parameters

      • json: ColorJSON

        The JSON to construct the instance from.

      Returns Color