tsParticles - v4.1.1
    Preparing search index...

    Module tsParticles Tetris Palette - v4.1.1

    banner

    tsParticles Tetris Palette

    jsDelivr npmjs npmjs GitHub Sponsors

    tsParticles palette featuring all 7 classic Tetris tetromino colors.

    Discord Telegram

    tsParticles Product Hunt

    demo

    All 7 classic tetromino colors:


    #6CE9ED
    I piece (Cyan)

    #0000E2
    J piece (Blue)

    #E5A238
    L piece (Orange)

    #F0F14F
    O piece (Yellow)

    #6DEA46
    S piece (Green)

    #911CE7
    T piece (Purple)

    #D92F20
    Z piece (Red)

    Background
    #0B0B1A
    Blend mode: screen | Fill: true
    1. Install @tsparticles/engine (or use the CDN bundle below)
    2. Load a base package (for example @tsparticles/basic) and call loadTetrisPalette before tsParticles.load(...)
    3. Apply the palette plus a minimal particles configuration in your options

    A palette defines colors, not complete behavior, so pair it with a runtime package and particle options.

    <script src="https://cdn.jsdelivr.net/npm/@tsparticles/basic@4/tsparticles.basic.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/@tsparticles/palette-tetris@4/tsparticles.palette-palette-tetris.min.js"></script>

    Once the scripts are loaded you can set up tsParticles like this:

    (async engine => {
    await loadBasic(engine);
    await loadTetrisPalette(engine);

    const options = {
    particles: {
    number: { value: 200 },
    shape: { type: "circle" },
    size: { value: { min: 10, max: 15 } },
    move: {
    enable: true,
    speed: 2,
    },
    },
    palette: "tetris",
    };

    await engine.load({
    id: "tsparticles",
    options,
    });
    })(tsParticles);

    Important ⚠️ You can override all the options defining the properties like in any standard tsParticles installation.

    Checkout the documentation in the component library repository and call the loadTetrisPalette function.

    Modules

    browser
    index
    index.lazy
    options