Tsparticles: Theme property in options

Created on 1 Aug 2020  路  6Comments  路  Source: matteobruni/tsparticles

Options should have a theme option that can be used to specify which options should be used, like the array index configuration.

This should help create particles themes creating a general preset that will be added to the tsParticles instance and the named options with customisations.

This is an example of how should work:

tsParticles.load("tsparticles", {
  themes: [
    {
      name: "light",
      default: true,
      options: {
        background: {
          color: "#fff"
        },
        particles: {
          color: {
            value: "#000" // black particles on light background
          }
        }
      }
    },
    {
      name: "dark",
      default: false, // this property defaults to false
      options: {
        background: {
          color: "#000"
        },
        particles: {
          color: {
            value: "#fff" // white particles on dark background
          }
        }
      }
    }
  ]
  /* all your cool options */
});

tsParticles.useTheme('light');
tsParticles.useTheme('dark');

This is what I think this feature should be

documentation enhancement feature_request good first issue help wanted pinned up-for-grabs

All 6 comments

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.93. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

I will like to fix this issue with some help!!

Hi @Himanshunitrr,

Welcome and thanks! If you want to discuss this issue or need help you can join Slack so we can talk more freely, otherwise we can discuss here if you don't want. No pressure 馃槈

What's your slack channel ?

Got it.

@Himanshunitrr you can see it working here in the alpha 3 version: https://codepen.io/matteobruni/full/rNeOaWP

Thanks for the help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adammesa picture adammesa  路  4Comments

ecrookoh picture ecrookoh  路  3Comments

darekaze picture darekaze  路  3Comments

lectair picture lectair  路  6Comments

paul300497 picture paul300497  路  5Comments