# Flash effect with brightness preFX

**URL:** <https://phaser.discourse.group/t/flash-effect-with-brightness-prefx/14625>\
**Category:** Examples\
**Created:** [August 9, 2024, 2:18pm UTC](https://phaser.discourse.group/t/flash-effect-with-brightness-prefx/14625 "2024-08-09T14:18:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [August 9, 2024, 2:18pm UTC](https://phaser.discourse.group/t/flash-effect-with-brightness-prefx/14625/1 "2024-08-09T14:18:22Z")

</div>

[https://phaser.io/sandbox/b4zjkBbv](https://phaser.io/sandbox/b4zjkBbv)

```js
const brightness = earth.preFX.addColorMatrix().brightness(2);

brightness.active = false;

this.input.on('pointerdown', () => {
  this.add.tween({
    targets: brightness,
    alpha: { from: 0, to: 1, yoyo: true, duration: 200, ease: 'Expo' },
    onStart: () => {
      brightness.active = true;
    },
    onComplete: () => {
      brightness.active = false;
    }
  });
});

```
