Create Sprite with Gradient

Show an example of how to create a sprite with a gradient in Phaser 3? And if this is possible, then the example of creating classes.

Are you looking for a simple gradient image? On WebGL, you can either use a fill tint (with, for example, a pure white image) or a Graphics object with gradient fill. If you need Canvas support, you’re best off making the texture yourself and loading it as an image; if you need it to be dynamic, you could also use a Canvas Texture.

Here are the relevant examples:

http://labs.phaser.io/view.html?src=src/display\tint\tint%20fill.js

http://labs.phaser.io/view.html?src=src/game%20objects\graphics\primitives\rectangle%20gradient%20filled.js

http://labs.phaser.io/view.html?src=src/textures\create%20canvas.js